1 package edu.rice.rubis.beans; 2 3 8 public class CommentPK implements java.io.Serializable { 9 10 public Integer id; 11 12 16 public CommentPK() {} 17 18 23 public CommentPK(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 41 47 public boolean equals(Object other) 48 { 49 boolean isEqual = false; 50 if (other instanceof CommentPK) 51 { 52 if (id == null) 53 isEqual = (id == ((CommentPK)other).id); 54 else 55 isEqual = (id.intValue() == ((CommentPK)other).id.intValue()); 56 } 57 return isEqual; 58 } 59 60 61 } 62 | Popular Tags |