KickJava   Java API By Example, From Geeks To Geeks.

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


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

8 public class InnerKey implements Serializable JavaDoc {
9     private String JavaDoc akey;
10     private String JavaDoc bkey;
11
12     public String JavaDoc getAkey() {
13         return akey;
14     }
15
16     public void setAkey(String JavaDoc akey) {
17         this.akey = akey;
18     }
19
20     public String JavaDoc getBkey() {
21         return bkey;
22     }
23
24     public void setBkey(String JavaDoc bkey) {
25         this.bkey = bkey;
26     }
27
28     public boolean equals(Object JavaDoc o) {
29         if (this == o) return true;
30         if (!(o instanceof InnerKey)) return false;
31
32         final InnerKey cidSuperID = (InnerKey) o;
33
34         if (akey != null ? !akey.equals(cidSuperID.akey) : cidSuperID.akey != null) return false;
35         if (bkey != null ? !bkey.equals(cidSuperID.bkey) : cidSuperID.bkey != null) return false;
36
37         return true;
38     }
39
40     public int hashCode() {
41         int result;
42         result = (akey != null ? akey.hashCode() : 0);
43         result = 29 * result + (bkey != null ? bkey.hashCode() : 0);
44         return result;
45     }
46 }
47
Popular Tags