KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > rentacar > persistance > bo > PartnerVO


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 /**
8  *
9  * @author ofabre
10  *
11  */

12 public class PartnerVO {
13     
14     private String JavaDoc partnerId;
15     
16     private ContactVO contact;
17
18     public PartnerVO() {
19         super();
20         // TODO Auto-generated constructor stub
21
}
22     
23     public PartnerVO(ContactVO contact) {
24         super();
25         this.contact = contact;
26     }
27
28     public PartnerVO(String JavaDoc partnerId, ContactVO contact) {
29         super();
30         // TODO Auto-generated constructor stub
31
this.partnerId = partnerId;
32         this.contact = contact;
33     }
34     
35     public PartnerVO(Partner partner) {
36         super();
37         // TODO Auto-generated constructor stub
38
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 JavaDoc getPartnerId() {
51         return partnerId;
52     }
53
54     public void setPartnerId(String JavaDoc partnerId) {
55         this.partnerId = partnerId;
56     }
57
58     /**
59      * @see java.lang.Object#equals(Object)
60      */

61     public boolean equals(Object JavaDoc 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     /**
71      * @see java.lang.Object#hashCode()
72      */

73     public int hashCode() {
74         return new HashCodeBuilder(-1604205539, -524900141)
75                 .append(this.contact).append(this.partnerId).toHashCode();
76     }
77
78     /**
79      * @see java.lang.Object#toString()
80      */

81     public String JavaDoc toString() {
82         return new ToStringBuilder(this).append("partnerId", this.partnerId)
83                 .append("contact", this.contact).toString();
84     }
85     
86     
87
88 }
89
Popular Tags