001: package org.springunit.framework.samples.jpetstore.domain;
002:
003: import org.apache.commons.lang.builder.CompareToBuilder;
004: import org.apache.commons.lang.builder.EqualsBuilder;
005: import org.apache.commons.lang.builder.HashCodeBuilder;
006: import org.apache.commons.lang.builder.ToStringBuilder;
007: import org.apache.commons.lang.builder.ToStringStyle;
008:
009: public class Account extends Persistable {
010:
011: public String getAddress1() {
012: return this .address1;
013: }
014:
015: public String getAddress2() {
016: return this .address2;
017: }
018:
019: public String getBannerName() {
020: return this .bannerName;
021: }
022:
023: public int isBannerOption() {
024: return this .bannerOption;
025: }
026:
027: public String getCity() {
028: return this .city;
029: }
030:
031: public String getCountry() {
032: return this .country;
033: }
034:
035: public String getEmail() {
036: return this .email;
037: }
038:
039: public Category getFavouriteCategory() {
040: return this .favouriteCategory;
041: }
042:
043: public String getFirstName() {
044: return this .firstName;
045: }
046:
047: public String getLanguagePreference() {
048: return this .languagePreference;
049: }
050:
051: public String getLastName() {
052: return this .lastName;
053: }
054:
055: public int isListOption() {
056: return this .listOption;
057: }
058:
059: public String getPassword() {
060: return this .password;
061: }
062:
063: public String getPhone() {
064: return this .phone;
065: }
066:
067: public String getState() {
068: return this .state;
069: }
070:
071: public String getStatus() {
072: return this .status;
073: }
074:
075: public String getUsername() {
076: return this .username;
077: }
078:
079: public String getZip() {
080: return this .zip;
081: }
082:
083: public void setAddress1(String address1) {
084: this .address1 = address1;
085: }
086:
087: public void setAddress2(String address2) {
088: this .address2 = address2;
089: }
090:
091: public void setBannerName(String bannerName) {
092: this .bannerName = bannerName;
093: }
094:
095: public void setBannerOption(int bannerOption) {
096: this .bannerOption = bannerOption;
097: }
098:
099: public void setCity(String city) {
100: this .city = city;
101: }
102:
103: public void setCountry(String country) {
104: this .country = country;
105: }
106:
107: public void setEmail(String email) {
108: this .email = email;
109: }
110:
111: public void setFavouriteCategory(Category favouriteCategory) {
112: this .favouriteCategory = favouriteCategory;
113: }
114:
115: public void setFirstName(String firstName) {
116: this .firstName = firstName;
117: }
118:
119: public void setLanguagePreference(String languagePreference) {
120: this .languagePreference = languagePreference;
121: }
122:
123: public void setLastName(String lastName) {
124: this .lastName = lastName;
125: }
126:
127: public void setListOption(int listOption) {
128: this .listOption = listOption;
129: }
130:
131: public void setPassword(String password) {
132: this .password = password;
133: }
134:
135: public void setPhone(String phone) {
136: this .phone = phone;
137: }
138:
139: public void setState(String state) {
140: this .state = state;
141: }
142:
143: public void setStatus(String status) {
144: this .status = status;
145: }
146:
147: public void setUsername(String username) {
148: this .username = username;
149: }
150:
151: public void setZip(String zip) {
152: this .zip = zip;
153: }
154:
155: public int compareTo(Object that) {
156: Account other = (Account) that;
157: return new CompareToBuilder().append(getUsername(),
158: other.getUsername()).toComparison();
159: }
160:
161: public boolean equals(Object that) {
162: if (this == that) {
163: return true;
164: }
165: if (!(that instanceof Account)) {
166: return false;
167: }
168: Account other = (Account) that;
169: return new EqualsBuilder().append(getUsername(),
170: other.getUsername()).isEquals();
171: }
172:
173: public int hashCode() {
174: return new HashCodeBuilder(PRIME, MULTIPLIER).append(
175: getUsername()).toHashCode();
176: }
177:
178: public String toString() {
179: return new ToStringBuilder(this , ToStringStyle.MULTI_LINE_STYLE)
180: .appendSuper(super .toString()).append("username",
181: getUsername())
182: .append("password", getPassword()).append("email",
183: getEmail()).append("firstName", getFirstName())
184: .append("lastName", getLastName()).append("status",
185: getStatus()).append("address1", getAddress1())
186: .append("address2", getAddress2()).append("city",
187: getCity()).append("state", getState()).append(
188: "zip", getZip())
189: .append("country", getCountry()).append("phone",
190: getPhone()).append("favouriteCategory",
191: getFavouriteCategory()).append(
192: "languagePreference", getLanguagePreference())
193: .append("listOption", isListOption()).append(
194: "bannerOption", isBannerOption()).append(
195: "bannerName", getBannerName()).toString();
196: }
197:
198: private static final long serialVersionUID = 3L;
199:
200: private String username;
201: private String password;
202: private String email;
203: private String firstName;
204: private String lastName;
205: private String status;
206: private String address1;
207: private String address2;
208: private String city;
209: private String state;
210: private String zip;
211: private String country;
212: private String phone;
213: private Category favouriteCategory;
214: private String languagePreference;
215: private int listOption;
216: private int bannerOption;
217: private String bannerName;
218:
219: }
|