1 25 26 package org.objectweb.jonas.jtests.beans.relation.dass; 27 28 31 public class P3PK implements java.io.Serializable { 32 public String id3; 33 public String id; 34 35 private int hashCode = -1; 36 37 public P3PK() { 38 } 39 40 public P3PK(String id3, String id) { 41 this.id3 = id3; 42 this.id = id; 43 } 44 45 public boolean equals(Object other) { 46 if (other == null) { 47 return false; 48 } 49 if (other == this) { 50 return true; 51 } 52 if (!(other instanceof P3PK)) { 53 return false; 54 } 55 P3PK otherPK = (P3PK) other; 56 return (id3.equals(otherPK.id3) && id.equals(otherPK.id)); 57 } 58 59 public int hashCode() { 60 if (hashCode == -1) { 61 hashCode = id3.hashCode(); 62 } 63 return hashCode; 64 } 65 66 public String toString() { 67 return(id3 + id); 68 } 69 } 70 71 | Popular Tags |