1 22 package org.jboss.test.banknew.interfaces; 23 24 27 public class BankData extends java.lang.Object implements java.io.Serializable 28 { 29 30 private static final long serialVersionUID = -5127677790748691817L; 31 32 private java.lang.String id; 33 34 private java.lang.String name; 35 36 private java.lang.String address; 37 38 public BankData() 39 { 40 } 41 42 public BankData(java.lang.String id, java.lang.String name, java.lang.String address) 43 { 44 setId(id); 45 setName(name); 46 setAddress(address); 47 } 48 49 public BankData(BankData otherData) 50 { 51 setId(otherData.getId()); 52 setName(otherData.getName()); 53 setAddress(otherData.getAddress()); 54 55 } 56 57 public org.jboss.test.banknew.interfaces.BankPK getPrimaryKey() 58 { 59 org.jboss.test.banknew.interfaces.BankPK pk = new org.jboss.test.banknew.interfaces.BankPK(this.getId()); 60 return pk; 61 } 62 63 public java.lang.String getId() 64 { 65 return this.id; 66 } 67 68 public void setId(java.lang.String id) 69 { 70 this.id = id; 71 } 72 73 public java.lang.String getName() 74 { 75 return this.name; 76 } 77 78 public void setName(java.lang.String name) 79 { 80 this.name = name; 81 } 82 83 public java.lang.String getAddress() 84 { 85 return this.address; 86 } 87 88 public void setAddress(java.lang.String address) 89 { 90 this.address = address; 91 } 92 93 public String toString() 94 { 95 StringBuffer str = new StringBuffer ("{"); 96 97 str.append("id=" + getId() + " " + "name=" + getName() + " " + "address=" + getAddress()); 98 str.append('}'); 99 100 return (str.toString()); 101 } 102 103 public boolean equals(Object pOther) 104 { 105 if (pOther instanceof BankData) 106 { 107 BankData lTest = (BankData) pOther; 108 boolean lEquals = true; 109 110 if (this.id == null) 111 { 112 lEquals = lEquals && (lTest.id == null); 113 } 114 else 115 { 116 lEquals = lEquals && this.id.equals(lTest.id); 117 } 118 if (this.name == null) 119 { 120 lEquals = lEquals && (lTest.name == null); 121 } 122 else 123 { 124 lEquals = lEquals && this.name.equals(lTest.name); 125 } 126 if (this.address == null) 127 { 128 lEquals = lEquals && (lTest.address == null); 129 } 130 else 131 { 132 lEquals = lEquals && this.address.equals(lTest.address); 133 } 134 135 return lEquals; 136 } 137 else 138 { 139 return false; 140 } 141 } 142 143 public int hashCode() 144 { 145 int result = 17; 146 147 result = 37 * result + ((this.id != null) ? this.id.hashCode() : 0); 148 149 result = 37 * result + ((this.name != null) ? this.name.hashCode() : 0); 150 151 result = 37 * result + ((this.address != null) ? this.address.hashCode() : 0); 152 153 return result; 154 } 155 156 } 157 | Popular Tags |