1 package edu.rice.rubis.beans; 2 3 8 public class CategoryPK implements java.io.Serializable { 9 10 public Integer id; 11 12 16 public CategoryPK() {} 17 18 23 public CategoryPK(Integer uniqueId) 24 { 25 id = uniqueId; 26 } 27 28 33 public int hashCode() 34 { 35 if (id == null) 36 return 0; 37 else 38 return id.intValue(); 39 } 40 46 public boolean equals(Object other) 47 { 48 boolean isEqual = false; 49 if (other instanceof CategoryPK) 50 { 51 if (id == null) 52 isEqual = (id == ((CategoryPK)other).id); 53 else 54 isEqual = (id.intValue() == ((CategoryPK)other).id.intValue()); 55 } 56 return isEqual; 57 } 58 59 60 } 61 | Popular Tags |