1 22 package org.jboss.test.banknew.interfaces; 23 24 27 public class BankPK extends java.lang.Object implements java.io.Serializable 28 { 29 30 private static final long serialVersionUID = 2608720469606729860L; 31 32 private int _hashCode = 0; 33 34 private StringBuffer _toStringValue = null; 35 36 public java.lang.String id; 37 38 public BankPK() 39 { 40 } 41 42 public BankPK(java.lang.String id) 43 { 44 this.id = id; 45 } 46 47 public java.lang.String getId() 48 { 49 return id; 50 } 51 52 public void setId(java.lang.String id) 53 { 54 this.id = id; 55 _hashCode = 0; 56 } 57 58 public int hashCode() 59 { 60 if (_hashCode == 0) 61 { 62 if (this.id != null) 63 _hashCode += this.id.hashCode(); 64 } 65 66 return _hashCode; 67 } 68 69 public boolean equals(Object obj) 70 { 71 if (!(obj instanceof org.jboss.test.banknew.interfaces.BankPK)) 72 return false; 73 74 org.jboss.test.banknew.interfaces.BankPK pk = (org.jboss.test.banknew.interfaces.BankPK) obj; 75 boolean eq = true; 76 77 if (obj == null) 78 { 79 eq = false; 80 } 81 else 82 { 83 if (this.id == null && ((org.jboss.test.banknew.interfaces.BankPK) obj).getId() == null) 84 { 85 eq = true; 86 } 87 else 88 { 89 if (this.id == null || ((org.jboss.test.banknew.interfaces.BankPK) obj).getId() == null) 90 { 91 eq = false; 92 } 93 else 94 { 95 eq = eq && this.id.equals(pk.id); 96 } 97 } 98 } 99 100 return eq; 101 } 102 103 104 public String toString() 105 { 106 if (_toStringValue == null) 107 { 108 _toStringValue = new StringBuffer ("[."); 109 _toStringValue.append(this.id).append('.'); 110 _toStringValue.append(']'); 111 } 112 113 return _toStringValue.toString(); 114 } 115 116 } 117 | Popular Tags |