1 11 12 package freeforums.message; 13 14 import java.io.Serializable ; 15 16 public class ReadMessagePK implements Serializable { 17 18 public String userName; 19 public Integer messageID; 20 21 public ReadMessagePK() { } 22 23 public ReadMessagePK(String userName, Integer messageID) { 24 25 this.userName = userName; 26 this.messageID = messageID; 27 28 } 29 30 public boolean equals(Object obj) { 31 32 if (obj==null || !(obj instanceof ReadMessagePK)) return false; 33 34 if ((((ReadMessagePK)obj).userName == this.userName) && (((ReadMessagePK)obj).messageID == this.messageID)) 35 return true; 36 37 return false; 39 } 40 41 public int hashCode() { return messageID.intValue(); } 42 43 public String toString() { return userName + " " + messageID; } 44 } 45 | Popular Tags |