1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.supercsv.mock;
17
18 import java.util.Date;
19
20
21
22
23
24
25
26 public class PersonBean {
27
28 private String firstName;
29
30 private String lastName;
31
32 private Date birthDate;
33
34 private Boolean married;
35
36 private Integer numberOfKids;
37
38 private String favouriteQuote;
39
40 private String email;
41
42
43
44
45 public PersonBean() {
46 }
47
48
49
50
51
52
53
54
55
56
57
58
59 public PersonBean(final String firstName, final String lastName, final Date birthDate, final Boolean married,
60 final Integer numberOfKids, final String favouriteQuote, final String email) {
61 this.firstName = firstName;
62 this.lastName = lastName;
63 this.birthDate = birthDate;
64 this.married = married;
65 this.numberOfKids = numberOfKids;
66 this.favouriteQuote = favouriteQuote;
67 this.email = email;
68 }
69
70
71
72
73 public String getFirstName() {
74 return firstName;
75 }
76
77
78
79
80
81 public void setFirstName(String firstName) {
82 this.firstName = firstName;
83 }
84
85
86
87
88 public String getLastName() {
89 return lastName;
90 }
91
92
93
94
95
96 public void setLastName(String lastName) {
97 this.lastName = lastName;
98 }
99
100
101
102
103 public Date getBirthDate() {
104 return birthDate;
105 }
106
107
108
109
110
111 public void setBirthDate(Date birthDate) {
112 this.birthDate = birthDate;
113 }
114
115
116
117
118 public Boolean getMarried() {
119 return married;
120 }
121
122
123
124
125
126 public void setMarried(Boolean married) {
127 this.married = married;
128 }
129
130
131
132
133 public Integer getNumberOfKids() {
134 return numberOfKids;
135 }
136
137
138
139
140
141 public void setNumberOfKids(Integer numberOfKids) {
142 this.numberOfKids = numberOfKids;
143 }
144
145
146
147
148 public String getEmail() {
149 return email;
150 }
151
152
153
154
155
156 public void setEmail(String email) {
157 this.email = email;
158 }
159
160
161
162
163 public String getFavouriteQuote() {
164 return favouriteQuote;
165 }
166
167
168
169
170
171 public void setFavouriteQuote(String favouriteQuote) {
172 this.favouriteQuote = favouriteQuote;
173 }
174
175 @Override
176 public int hashCode() {
177 final int prime = 31;
178 int result = 1;
179 result = prime * result + ((birthDate == null) ? 0 : birthDate.hashCode());
180 result = prime * result + ((email == null) ? 0 : email.hashCode());
181 result = prime * result + ((favouriteQuote == null) ? 0 : favouriteQuote.hashCode());
182 result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
183 result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
184 result = prime * result + ((married == null) ? 0 : married.hashCode());
185 result = prime * result + ((numberOfKids == null) ? 0 : numberOfKids.hashCode());
186 return result;
187 }
188
189 @Override
190 public boolean equals(Object obj) {
191 if( this == obj ) {
192 return true;
193 }
194 if( obj == null ) {
195 return false;
196 }
197 if( !(obj instanceof PersonBean) ) {
198 return false;
199 }
200 PersonBean other = (PersonBean) obj;
201 if( birthDate == null ) {
202 if( other.birthDate != null ) {
203 return false;
204 }
205 } else if( !birthDate.equals(other.birthDate) ) {
206 return false;
207 }
208 if( email == null ) {
209 if( other.email != null ) {
210 return false;
211 }
212 } else if( !email.equals(other.email) ) {
213 return false;
214 }
215 if( favouriteQuote == null ) {
216 if( other.favouriteQuote != null ) {
217 return false;
218 }
219 } else if( !favouriteQuote.equals(other.favouriteQuote) ) {
220 return false;
221 }
222 if( firstName == null ) {
223 if( other.firstName != null ) {
224 return false;
225 }
226 } else if( !firstName.equals(other.firstName) ) {
227 return false;
228 }
229 if( lastName == null ) {
230 if( other.lastName != null ) {
231 return false;
232 }
233 } else if( !lastName.equals(other.lastName) ) {
234 return false;
235 }
236 if( married == null ) {
237 if( other.married != null ) {
238 return false;
239 }
240 } else if( !married.equals(other.married) ) {
241 return false;
242 }
243 if( numberOfKids == null ) {
244 if( other.numberOfKids != null ) {
245 return false;
246 }
247 } else if( !numberOfKids.equals(other.numberOfKids) ) {
248 return false;
249 }
250 return true;
251 }
252
253 @Override
254 public String toString() {
255 return String
256 .format(
257 "PersonBean [firstName=%s, lastName=%s, birthDate=%s, married=%s, numberOfKids=%s, favouriteQuote=%s, email=%s]",
258 firstName, lastName, birthDate, married, numberOfKids, favouriteQuote, email);
259 }
260
261 }