KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > legacy > MiddleKey


1 package org.hibernate.test.legacy;
2
3 import java.io.Serializable JavaDoc;
4
5 /**
6  * @author Stefano Travelli
7  */

8 public class MiddleKey implements Serializable JavaDoc {
9     private Inner sup;
10     private String JavaDoc one;
11     private String JavaDoc two;
12
13     public String JavaDoc getOne() {
14         return one;
15     }
16
17     public void setOne(String JavaDoc one) {
18         this.one = one;
19     }
20
21     public String JavaDoc getTwo() {
22         return two;
23     }
24
25     public void setTwo(String JavaDoc two) {
26         this.two = two;
27     }
28
29     public Inner getSup() {
30         return sup;
31     }
32
33     public void setSup(Inner sup) {
34         this.sup = sup;
35     }
36
37     public boolean equals(Object JavaDoc o) {
38         if (this == o) return true;
39         if (!(o instanceof MiddleKey)) return false;
40
41         final MiddleKey cidMasterID = (MiddleKey) o;
42
43         if (one != null ? !one.equals(cidMasterID.one) : cidMasterID.one != null) return false;
44         if (sup != null ? !sup.equals(cidMasterID.sup) : cidMasterID.sup != null) return false;
45         if (two != null ? !two.equals(cidMasterID.two) : cidMasterID.two != null) return false;
46
47         return true;
48     }
49
50     public int hashCode() {
51         int result;
52         result = (sup != null ? sup.hashCode() : 0);
53         result = 29 * result + (one != null ? one.hashCode() : 0);
54         result = 29 * result + (two != null ? two.hashCode() : 0);
55         return result;
56     }
57 }
58
Popular Tags