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