01: package org.apache.ojb.broker;
02:
03: import java.io.Serializable;
04: import java.util.Date;
05:
06: import org.apache.ojb.broker.util.GUID;
07:
08: /**
09: * @author tom
10: *
11: * To change this generated comment edit the template variable "typecomment":
12: * Window>Preferences>Java>Templates.
13: * To enable and disable the creation of type comments go to
14: * Window>Preferences>Java>Code Generation.
15: */
16: public class GuidTestEntity implements Serializable {
17: private GUID guid;
18: private String value;
19:
20: /**
21: * Constructor for GuidTestEntity.
22: */
23: public GuidTestEntity() {
24: super ();
25: guid = new GUID();
26: value = new Date().toString();
27: }
28:
29: /**
30: * Returns the guid.
31: * @return GUID
32: */
33: public GUID getGuid() {
34: return guid;
35: }
36:
37: /**
38: * Returns the value.
39: * @return String
40: */
41: public String getValue() {
42: return value;
43: }
44:
45: /**
46: * Sets the guid.
47: * @param guid The guid to set
48: */
49: public void setGuid(GUID guid) {
50: this .guid = guid;
51: }
52:
53: /**
54: * Sets the value.
55: * @param value The value to set
56: */
57: public void setValue(String value) {
58: this .value = value;
59: }
60:
61: /**
62: * @see java.lang.Object#hashCode()
63: */
64: public int hashCode() {
65: return guid.hashCode();
66: }
67:
68: /**
69: * @see java.lang.Object#toString()
70: */
71: public String toString() {
72: return guid.toString() + " : " + value;
73: }
74:
75: /**
76: * @see java.lang.Object#equals(Object)
77: */
78: public boolean equals(Object obj) {
79: if (obj instanceof GuidTestEntity) {
80: if (((GuidTestEntity) obj).getGuid().equals(this .getGuid())) {
81: return true;
82: }
83: }
84: return false;
85: }
86:
87: }
|