1 package org.objectweb.rentacar.persistance.bo; 2 3 import org.apache.commons.lang.builder.EqualsBuilder; 4 import org.apache.commons.lang.builder.HashCodeBuilder; 5 import org.apache.commons.lang.builder.ToStringBuilder; 6 7 12 public class PartnerVO { 13 14 private String partnerId; 15 16 private ContactVO contact; 17 18 public PartnerVO() { 19 super(); 20 } 22 23 public PartnerVO(ContactVO contact) { 24 super(); 25 this.contact = contact; 26 } 27 28 public PartnerVO(String partnerId, ContactVO contact) { 29 super(); 30 this.partnerId = partnerId; 32 this.contact = contact; 33 } 34 35 public PartnerVO(Partner partner) { 36 super(); 37 this.partnerId = partner.getPartnerId(); 39 this.contact = new ContactVO(partner.getContact()); 40 } 41 42 public ContactVO getContact() { 43 return contact; 44 } 45 46 public void setContact(ContactVO contact) { 47 this.contact = contact; 48 } 49 50 public String getPartnerId() { 51 return partnerId; 52 } 53 54 public void setPartnerId(String partnerId) { 55 this.partnerId = partnerId; 56 } 57 58 61 public boolean equals(Object object) { 62 if (!(object instanceof PartnerVO)) { 63 return false; 64 } 65 PartnerVO rhs = (PartnerVO) object; 66 return new EqualsBuilder().append(this.contact, rhs.contact).append( 67 this.partnerId, rhs.partnerId).isEquals(); 68 } 69 70 73 public int hashCode() { 74 return new HashCodeBuilder(-1604205539, -524900141) 75 .append(this.contact).append(this.partnerId).toHashCode(); 76 } 77 78 81 public String toString() { 82 return new ToStringBuilder(this).append("partnerId", this.partnerId) 83 .append("contact", this.contact).toString(); 84 } 85 86 87 88 } 89 | Popular Tags |