/
SUserImpl.java
352 lines (297 loc) · 9.81 KB
/
SUserImpl.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
/**
* Copyright (C) 2009-2013 BonitaSoft S.A.
* BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This library is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation
* version 2.1 of the License.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
package org.bonitasoft.engine.identity.model.impl;
import org.bonitasoft.engine.identity.model.SUser;
/**
* @author Anthony Birembaut
* @author Baptiste Mesta
* @author Yanyan Liu
* @author Matthieu Chaffotte
* @author Emmanuel Duchastenier
* @author Celine Souchet
*/
public class SUserImpl extends SPersistentObjectImpl implements SUser {
private static final long serialVersionUID = 9149996775946617264L;
private String firstName;
private String lastName;
private String password;
private String userName;
private String iconName;
private String iconPath;
private long managerUserId;
private String delegeeUserName;
private String title;
private String jobTitle;
private long creationDate;
private long createdBy;
private long lastUpdate;
private Long lastConnection;
private boolean enabled;
public SUserImpl() {
super();
}
public SUserImpl(final SUser user) {
firstName = user.getFirstName();
lastName = user.getLastName();
password = user.getPassword();
userName = user.getUserName();
jobTitle = user.getJobTitle();
delegeeUserName = user.getDelegeeUserName();
managerUserId = user.getManagerUserId();
iconName = user.getIconName();
iconPath = user.getIconPath();
createdBy = user.getCreatedBy();
creationDate = user.getCreationDate();
lastUpdate = user.getLastUpdate();
lastConnection = user.getLastConnection();
title = user.getTitle();
enabled = user.isEnabled();
}
@Override
public String getFirstName() {
return firstName;
}
@Override
public String getLastName() {
return lastName;
}
@Override
public String getPassword() {
return password;
}
@Override
public String getUserName() {
return userName;
}
@Override
public String getTitle() {
return title;
}
@Override
public String getJobTitle() {
return jobTitle;
}
@Override
public String getDelegeeUserName() {
return delegeeUserName;
}
@Override
public String getDiscriminator() {
return SUser.class.getName();
}
@Override
public long getManagerUserId() {
return managerUserId;
}
@Override
public String getIconName() {
return iconName;
}
@Override
public String getIconPath() {
return iconPath;
}
@Override
public long getCreationDate() {
return creationDate;
}
@Override
public long getCreatedBy() {
return createdBy;
}
@Override
public long getLastUpdate() {
return lastUpdate;
}
@Override
public Long getLastConnection() {
return lastConnection;
}
@Override
public boolean isEnabled() {
return enabled;
}
public void setFirstName(final String firstName) {
this.firstName = firstName;
}
public void setLastName(final String lastName) {
this.lastName = lastName;
}
public void setPassword(final String password) {
this.password = password;
}
public void setUserName(final String username) {
userName = username;
}
public void setTitle(final String title) {
this.title = title;
}
public void setJobTitle(final String jobTitle) {
this.jobTitle = jobTitle;
}
public void setManagerUserId(final long managerUserId) {
this.managerUserId = managerUserId;
}
public void setDelegeeUserName(final String delegeeUserName) {
this.delegeeUserName = delegeeUserName;
}
public void setIconName(final String iconName) {
this.iconName = iconName;
}
public void setIconPath(final String iconPath) {
this.iconPath = iconPath;
}
public void setCreationDate(final long creationDate) {
this.creationDate = creationDate;
}
public void setCreatedBy(final long createdBy) {
this.createdBy = createdBy;
}
public void setLastUpdate(final long lastUpdate) {
this.lastUpdate = lastUpdate;
}
public void setLastConnection(final Long lastConnection) {
this.lastConnection = lastConnection;
}
public void setEnabled(final boolean enabled) {
this.enabled = enabled;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + (int) (createdBy ^ createdBy >>> 32);
result = prime * result + (int) (creationDate ^ creationDate >>> 32);
result = prime * result + (delegeeUserName == null ? 0 : delegeeUserName.hashCode());
result = prime * result + (firstName == null ? 0 : firstName.hashCode());
result = prime * result + (iconName == null ? 0 : iconName.hashCode());
result = prime * result + (iconPath == null ? 0 : iconPath.hashCode());
result = prime * result + (jobTitle == null ? 0 : jobTitle.hashCode());
result = prime * result + (lastConnection == null ? 0 : lastConnection.hashCode());
result = prime * result + (lastName == null ? 0 : lastName.hashCode());
result = prime * result + (int) (lastUpdate ^ lastUpdate >>> 32);
result = prime * result + (int) (managerUserId ^ managerUserId >>> 32);
result = prime * result + (password == null ? 0 : password.hashCode());
result = prime * result + (title == null ? 0 : title.hashCode());
result = prime * result + (userName == null ? 0 : userName.hashCode());
result = prime * result + Boolean.valueOf(enabled).hashCode();
return result;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final SUserImpl other = (SUserImpl) obj;
if (createdBy != other.createdBy) {
return false;
}
if (creationDate != other.creationDate) {
return false;
}
if (delegeeUserName == null) {
if (other.delegeeUserName != null) {
return false;
}
} else if (!delegeeUserName.equals(other.delegeeUserName)) {
return false;
}
if (firstName == null) {
if (other.firstName != null) {
return false;
}
} else if (!firstName.equals(other.firstName)) {
return false;
}
if (iconName == null) {
if (other.iconName != null) {
return false;
}
} else if (!iconName.equals(other.iconName)) {
return false;
}
if (iconPath == null) {
if (other.iconPath != null) {
return false;
}
} else if (!iconPath.equals(other.iconPath)) {
return false;
}
if (jobTitle == null) {
if (other.jobTitle != null) {
return false;
}
} else if (!jobTitle.equals(other.jobTitle)) {
return false;
}
if (lastConnection == null) {
if (other.lastConnection != null) {
return false;
}
} else if (!lastConnection.equals(other.lastConnection)) {
return false;
}
if (lastName == null) {
if (other.lastName != null) {
return false;
}
} else if (!lastName.equals(other.lastName)) {
return false;
}
if (lastUpdate != other.lastUpdate) {
return false;
}
if (managerUserId != other.managerUserId) {
return false;
}
if (password == null) {
if (other.password != null) {
return false;
}
} else if (!password.equals(other.password)) {
return false;
}
if (title == null) {
if (other.title != null) {
return false;
}
} else if (!title.equals(other.title)) {
return false;
}
if (userName == null) {
if (other.userName != null) {
return false;
}
} else if (!userName.equals(other.userName)) {
return false;
}
if (enabled != other.enabled) {
return false;
}
return true;
}
@Override
public String toString() {
return "SUserImpl (" + getId() + ") [firstName=" + firstName + ", lastName=" + lastName + ", password=" + password + ", userName=" + userName
+ ", iconName=" + iconName + ", iconPath=" + iconPath + ", managerUserId=" + managerUserId + ", delegeeUserName=" + delegeeUserName
+ ", title=" + title + ", jobTitle=" + jobTitle + ", creationDate=" + creationDate + ", createdBy=" + createdBy + ", lastUpdate=" + lastUpdate
+ ", lastConnection=" + lastConnection + ", enabled=" + enabled + "]";
}
}