1 package org.apache.ojb.broker; 2 3 import java.io.Serializable ; 4 import java.util.Date ; 5 6 import org.apache.ojb.broker.util.GUID; 7 8 16 public class GuidTestEntity implements Serializable 17 { 18 private GUID guid; 19 private String value; 20 21 24 public GuidTestEntity() 25 { 26 super(); 27 guid = new GUID(); 28 value = new Date ().toString(); 29 } 30 31 35 public GUID getGuid() 36 { 37 return guid; 38 } 39 40 44 public String getValue() 45 { 46 return value; 47 } 48 49 53 public void setGuid(GUID guid) 54 { 55 this.guid = guid; 56 } 57 58 62 public void setValue(String value) 63 { 64 this.value = value; 65 } 66 67 70 public int hashCode() 71 { 72 return guid.hashCode(); 73 } 74 75 78 public String toString() 79 { 80 return guid.toString() + " : " + value; 81 } 82 83 86 public boolean equals(Object obj) 87 { 88 if (obj instanceof GuidTestEntity) 89 { 90 if (((GuidTestEntity) obj).getGuid().equals(this.getGuid())) 91 { 92 return true; 93 } 94 } 95 return false; 96 } 97 98 } 99 | Popular Tags |