1 18 19 20 package sync4j.framework.engine; 21 22 29 public class SyncItemKey implements java.io.Serializable { 30 31 33 36 private Object keyValue = null; 37 public Object getKeyValue(){ 38 return keyValue; 39 } 40 41 44 public void setKeyValue(Object keyValue){ 45 assert (keyValue != null); 46 this.keyValue = keyValue; 47 } 48 49 51 54 public SyncItemKey(Object keyValue) { 55 assert (keyValue != null); 56 this.keyValue = keyValue; 57 } 58 59 61 65 public String getKeyAsString() { 66 return keyValue.toString(); 67 } 68 69 78 public boolean equals(Object o) { 79 if (!(o instanceof SyncItemKey)) return false; 80 81 return ((SyncItemKey)o).getKeyAsString().equals(getKeyAsString()); 82 } 83 84 89 public int hashCode() { 90 return getKeyAsString().hashCode(); 91 } 92 93 96 public String toString() { 97 StringBuffer sb = new StringBuffer (); 98 99 sb.append( " { keyValue: " ); 100 sb.append( getKeyAsString() ); 101 sb.append( " } " ); 102 103 return sb.toString(); 104 } 105 } | Popular Tags |