1 7 package org.jboss.cache.tests.aop; 8 9 12 public class IdObject{ 13 14 private String id; 15 16 public IdObject() { 17 } 19 public IdObject(String aId) { 20 id = aId; 21 } 23 24 public String toString() { 25 return id; 26 } 28 public boolean equals(Object aObject) { 29 boolean result = false; 30 31 if ((aObject != null) && 32 (aObject.getClass().getName().equals( this.getClass().getName()))) { 33 if (id.equals(((IdObject)aObject).id)) { 34 result = true; 35 } } 38 return result; 39 } 41 public int hashCode() { 42 return id.hashCode(); 43 } } 46 | Popular Tags |