1 22 package org.jboss.test.banknew.interfaces; 23 24 27 public class TransactionData extends java.lang.Object implements java.io.Serializable 28 { 29 30 private static final long serialVersionUID = 8601981534267975114L; 31 32 private java.lang.String id; 33 34 private java.lang.String acountId; 35 36 private int type; 37 38 private float amount; 39 40 private java.util.Date date; 41 42 private java.lang.String description; 43 44 public TransactionData() 45 { 46 } 47 48 public TransactionData(java.lang.String id, java.lang.String acountId, int type, float amount, java.util.Date date, 49 java.lang.String description) 50 { 51 setId(id); 52 setAcountId(acountId); 53 setType(type); 54 setAmount(amount); 55 setDate(date); 56 setDescription(description); 57 } 58 59 public TransactionData(TransactionData otherData) 60 { 61 setId(otherData.getId()); 62 setAcountId(otherData.getAcountId()); 63 setType(otherData.getType()); 64 setAmount(otherData.getAmount()); 65 setDate(otherData.getDate()); 66 setDescription(otherData.getDescription()); 67 68 } 69 70 public org.jboss.test.banknew.interfaces.TransactionPK getPrimaryKey() 71 { 72 org.jboss.test.banknew.interfaces.TransactionPK pk = new org.jboss.test.banknew.interfaces.TransactionPK(this 73 .getId()); 74 return pk; 75 } 76 77 public java.lang.String getId() 78 { 79 return this.id; 80 } 81 82 public void setId(java.lang.String id) 83 { 84 this.id = id; 85 } 86 87 public java.lang.String getAcountId() 88 { 89 return this.acountId; 90 } 91 92 public void setAcountId(java.lang.String acountId) 93 { 94 this.acountId = acountId; 95 } 96 97 public int getType() 98 { 99 return this.type; 100 } 101 102 public void setType(int type) 103 { 104 this.type = type; 105 } 106 107 public float getAmount() 108 { 109 return this.amount; 110 } 111 112 public void setAmount(float amount) 113 { 114 this.amount = amount; 115 } 116 117 public java.util.Date getDate() 118 { 119 return this.date; 120 } 121 122 public void setDate(java.util.Date date) 123 { 124 this.date = date; 125 } 126 127 public java.lang.String getDescription() 128 { 129 return this.description; 130 } 131 132 public void setDescription(java.lang.String description) 133 { 134 this.description = description; 135 } 136 137 public String toString() 138 { 139 StringBuffer str = new StringBuffer ("{"); 140 141 str.append("id=" + getId() + " " + "acountId=" + getAcountId() + " " + "type=" + getType() + " " + "amount=" 142 + getAmount() + " " + "date=" + getDate() + " " + "description=" + getDescription()); 143 str.append('}'); 144 145 return (str.toString()); 146 } 147 148 public boolean equals(Object pOther) 149 { 150 if (pOther instanceof TransactionData) 151 { 152 TransactionData lTest = (TransactionData) pOther; 153 boolean lEquals = true; 154 155 if (this.id == null) 156 { 157 lEquals = lEquals && (lTest.id == null); 158 } 159 else 160 { 161 lEquals = lEquals && this.id.equals(lTest.id); 162 } 163 if (this.acountId == null) 164 { 165 lEquals = lEquals && (lTest.acountId == null); 166 } 167 else 168 { 169 lEquals = lEquals && this.acountId.equals(lTest.acountId); 170 } 171 lEquals = lEquals && this.type == lTest.type; 172 lEquals = lEquals && this.amount == lTest.amount; 173 if (this.date == null) 174 { 175 lEquals = lEquals && (lTest.date == null); 176 } 177 else 178 { 179 lEquals = lEquals && this.date.equals(lTest.date); 180 } 181 if (this.description == null) 182 { 183 lEquals = lEquals && (lTest.description == null); 184 } 185 else 186 { 187 lEquals = lEquals && this.description.equals(lTest.description); 188 } 189 190 return lEquals; 191 } 192 else 193 { 194 return false; 195 } 196 } 197 198 public int hashCode() 199 { 200 int result = 17; 201 202 result = 37 * result + ((this.id != null) ? this.id.hashCode() : 0); 203 204 result = 37 * result + ((this.acountId != null) ? this.acountId.hashCode() : 0); 205 206 result = 37 * result + type; 207 208 result = 37 * result + Float.floatToIntBits(amount); 209 210 result = 37 * result + ((this.date != null) ? this.date.hashCode() : 0); 211 212 result = 37 * result + ((this.description != null) ? this.description.hashCode() : 0); 213 214 return result; 215 } 216 217 } 218 | Popular Tags |