1 7 package org.jboss.cache.pojo.test; 8 9 12 @org.jboss.cache.pojo.annotation.Replicable 14 public class ValueObject 15 { 16 17 private IdObject idObj; 18 private float value; 19 20 public ValueObject() 21 { 22 } 24 public ValueObject(IdObject aIdObj, float aValue) 25 { 26 idObj = aIdObj; 27 value = aValue; 28 } 30 public IdObject getIdObj() 31 { 32 return idObj; 33 } 34 35 public float getValue() 36 { 37 return value; 38 } 39 40 public String toString() 41 { 42 return idObj + ": " + value; 43 } 45 public boolean equals(Object aObject) 46 { 47 boolean result = false; 48 49 if ((aObject != null) && 50 (aObject.getClass().getName().equals(this.getClass().getName()))) 51 { 52 result = idObj.equals(((ValueObject) aObject).idObj); 53 } 55 return result; 56 } 58 public int hashCode() 59 { 60 return idObj.hashCode(); 61 } } | Popular Tags |