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