KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: Stuff.java,v 1.1 2004/09/26 05:18:25 oneovthafew Exp $
2
package org.hibernate.test.legacy;
3
4 import java.io.Serializable JavaDoc;
5 import java.util.TimeZone JavaDoc;
6
7 public class Stuff implements Serializable JavaDoc {
8     
9     public int hashCode() {
10         return new Long JavaDoc(id).hashCode();
11     }
12     
13     public boolean equals(Object JavaDoc other) {
14         if ( ! (other instanceof Stuff) ) return false;
15         Stuff otherStuff = (Stuff) other;
16         return otherStuff.getId()==id && otherStuff.getFoo().getKey().equals( foo.getKey() ) && otherStuff.getMoreStuff().equals(moreStuff);
17     }
18     
19     private long id;
20     private FooProxy foo;
21     private MoreStuff moreStuff;
22     private TimeZone JavaDoc property;
23     /**
24      * Returns the foo.
25      * @return Foo
26      */

27     public FooProxy getFoo() {
28         return foo;
29     }
30     
31     /**
32      * Returns the id.
33      * @return long
34      */

35     public long getId() {
36         return id;
37     }
38     
39     /**
40      * Returns the property.
41      * @return TimeZone
42      */

43     public TimeZone JavaDoc getProperty() {
44         return property;
45     }
46     
47     /**
48      * Sets the foo.
49      * @param foo The foo to set
50      */

51     public void setFoo(FooProxy foo) {
52         this.foo = foo;
53     }
54     
55     /**
56      * Sets the id.
57      * @param id The id to set
58      */

59     public void setId(long id) {
60         this.id = id;
61     }
62     
63     /**
64      * Sets the property.
65      * @param property The property to set
66      */

67     public void setProperty(TimeZone JavaDoc property) {
68         this.property = property;
69     }
70     
71     /**
72      * Returns the moreStuff.
73      * @return MoreStuff
74      */

75     public MoreStuff getMoreStuff() {
76         return moreStuff;
77     }
78     
79     /**
80      * Sets the moreStuff.
81      * @param moreStuff The moreStuff to set
82      */

83     public void setMoreStuff(MoreStuff moreStuff) {
84         this.moreStuff = moreStuff;
85     }
86     
87 }
88
89
90
91
92
93
94
Popular Tags