KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > usercollection > Email


1 //$Id$
2
package org.hibernate.test.usercollection;
3
4 /**
5  * @author Gavin King
6  */

7 public class Email {
8     
9     private Long JavaDoc id;
10     private String JavaDoc address;
11     
12     Email() {}
13     
14     public String JavaDoc getAddress() {
15         return address;
16     }
17     public void setAddress(String JavaDoc type) {
18         this.address = type;
19     }
20     public Email(String JavaDoc type) {
21         this.address = type;
22     }
23     public boolean equals(Object JavaDoc that) {
24         if ( !(that instanceof Email) ) return false;
25         Email p = (Email) that;
26         return this.address.equals(p.address);
27     }
28     public int hashCode() {
29         return address.hashCode();
30     }
31     
32     public Long JavaDoc getId() {
33         return id;
34     }
35     
36     private void setId(Long JavaDoc id) {
37         this.id = id;
38     }
39 }
40
Popular Tags