summaryrefslogtreecommitdiffstats
path: root/portal-BE/src/main/java/org/onap/portal/domain/builder/FnUserBuilder.java
blob: fe8aadb6676462a22fa8235478bd961b09e3dcb1 (plain)
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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
/*
 * ============LICENSE_START==========================================
 * ONAP Portal
 * ===================================================================
 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
 * ===================================================================
 * Modifications Copyright (c) 2019 Samsung
 * ===================================================================
 *
 * Unless otherwise specified, all software contained herein is licensed
 * under the Apache License, Version 2.0 (the "License");
 * you may not use this software except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *             http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Unless otherwise specified, all documentation contained herein is licensed
 * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
 * you may not use this documentation except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *             https://creativecommons.org/licenses/by/4.0/
 *
 * Unless required by applicable law or agreed to in writing, documentation
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * ============LICENSE_END============================================
 *
 *
 */

package org.onap.portal.domain.builder;

import java.time.LocalDateTime;
import java.util.Set;
import java.util.UUID;
import javax.validation.Valid;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.PastOrPresent;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.SafeHtml;
import org.onap.portal.domain.db.cr.CrReportFileHistory;
import org.onap.portal.domain.db.ep.EpPersUserWidgetPlacement;
import org.onap.portal.domain.db.ep.EpPersUserWidgetSel;
import org.onap.portal.domain.db.ep.EpUserNotification;
import org.onap.portal.domain.db.ep.EpUserRolesRequest;
import org.onap.portal.domain.db.ep.EpWidgetCatalogParameter;
import org.onap.portal.domain.db.fn.FnAuditLog;
import org.onap.portal.domain.db.fn.FnLanguage;
import org.onap.portal.domain.db.fn.FnLuAlertMethod;
import org.onap.portal.domain.db.fn.FnLuTimezone;
import org.onap.portal.domain.db.fn.FnMenuFunctional;
import org.onap.portal.domain.db.fn.FnOrg;
import org.onap.portal.domain.db.fn.FnPersUserAppSel;
import org.onap.portal.domain.db.fn.FnRole;
import org.onap.portal.domain.db.fn.FnUser;
import org.onap.portal.domain.db.fn.FnUserRole;
import org.springframework.stereotype.Component;

@Component
public class FnUserBuilder {

       private @Digits(integer = 11, fraction = 0) Long userId;
       private @Valid FnOrg orgId;
       private @Valid FnUser managerId;
       private @Size(max = 50)
       @SafeHtml String firstName;
       private @Size(max = 50)
       @SafeHtml String middleName;
       private @Size(max = 50)
       @SafeHtml String lastName;
       private @Size(max = 25)
       @SafeHtml String phone;
       private @Size(max = 25)
       @SafeHtml String fax;
       private @Size(max = 25)
       @SafeHtml String cellular;
       private @Size(max = 50) @Email
       @SafeHtml String email;
       private @Digits(integer = 11, fraction = 0) Long addressId;
       private FnLuAlertMethod alertMethodCd;
       private @Size(max = 20)
       @SafeHtml String hrid;
       private @Size(max = 20)
       @SafeHtml String orgUserId;
       private @Size(max = 30)
       @SafeHtml String org_code;
       private @Size(max = 25)
       @SafeHtml String loginId;
       private @Size(max = 100)
       @SafeHtml String loginPwd;
       private @PastOrPresent LocalDateTime lastLoginDate;
       private @Size(max = 1)
       @SafeHtml
       @NotNull(message = "activeYn must not be null") String activeYn;
       private @Valid FnUser createdId;
       private @PastOrPresent LocalDateTime createdDate;
       private @Valid FnUser modifiedId;
       private @PastOrPresent LocalDateTime modifiedDate;
       private @Size(max = 1)
       @SafeHtml
       @NotNull(message = "isInternalYn must not be null") String isInternalYn;
       private @Size(max = 100)
       @SafeHtml String addressLine1;
       private @Size(max = 100)
       @SafeHtml String addressLine2;
       private @Size(max = 50)
       @SafeHtml String city;
       private @Size(max = 3)
       @SafeHtml String stateCd;
       private @Size(max = 11)
       @SafeHtml String zipCode;
       private @Size(max = 3)
       @SafeHtml String countryCd;
       private @Size(max = 8)
       @SafeHtml String locationClli;
       private @Size(max = 20)
       @SafeHtml String orgManagerUserId;
       private @Size(max = 100)
       @SafeHtml String company;
       private @Size(max = 200)
       @SafeHtml String departmentName;
       private @Size(max = 100)
       @SafeHtml String jobTitle;
       private @Valid FnLuTimezone timezone;
       private @Size(max = 25)
       @SafeHtml String department;
       private @Size(max = 25)
       @SafeHtml String businessUnit;
       private @Size(max = 100)
       @SafeHtml String businessUnitName;
       private @Size(max = 25)
       @SafeHtml String cost_center;
       private @Size(max = 10)
       @SafeHtml String finLocCode;
       private @Size(max = 10)
       @SafeHtml String siloStatus;
       private @Valid @NotNull(message = "languageId must not be null") FnLanguage languageId;
       private @NotNull(message = "guest must not be null") boolean guest;
       private Set<CrReportFileHistory> crReportFileHistorie;
       private Set<FnRole> fnRoles;
       private Set<FnMenuFunctional> fnRoleList;
       private Set<FnAuditLog> fnAuditLogs;
       private Set<FnUser> fnUsersCreatedId;
       private Set<FnUser> fnUsersManagerId;
       private Set<FnUser> fnUsersModifiedId;
       private Set<EpUserRolesRequest> epUserRolesRequests;
       private Set<FnPersUserAppSel> persUserAppSels;
       private Set<EpWidgetCatalogParameter> epWidgetCatalogParameters;
       private Set<EpPersUserWidgetPlacement> epPersUserWidgetPlacements;
       private Set<EpPersUserWidgetSel> epPersUserWidgetSels;
       private Set<FnUserRole> fnUserRoles;
       private Set<EpUserNotification> epUserNotifications;

       public FnUserBuilder setUserId(@Digits(integer = 11, fraction = 0) Long userId) {
              this.userId = userId;
              return this;
       }

       public FnUserBuilder setOrgId(@Valid FnOrg orgId) {
              this.orgId = orgId;
              return this;
       }

       public FnUserBuilder setManagerId(@Valid FnUser managerId) {
              this.managerId = managerId;
              return this;
       }

       public FnUserBuilder setFirstName(@Size(max = 50) @SafeHtml String firstName) {
              this.firstName = firstName;
              return this;
       }

       public FnUserBuilder setMiddleName(@Size(max = 50) @SafeHtml String middleName) {
              this.middleName = middleName;
              return this;
       }

       public FnUserBuilder setLastName(@Size(max = 50) @SafeHtml String lastName) {
              this.lastName = lastName;
              return this;
       }

       public FnUserBuilder setPhone(@Size(max = 25) @SafeHtml String phone) {
              this.phone = phone;
              return this;
       }

       public FnUserBuilder setFax(@Size(max = 25) @SafeHtml String fax) {
              this.fax = fax;
              return this;
       }

       public FnUserBuilder setCellular(@Size(max = 25) @SafeHtml String cellular) {
              this.cellular = cellular;
              return this;
       }

       public FnUserBuilder setEmail(@Size(max = 50) @Email @SafeHtml String email) {
              this.email = email;
              return this;
       }

       public FnUserBuilder setAddressId(@Digits(integer = 11, fraction = 0) Long addressId) {
              this.addressId = addressId;
              return this;
       }

       public FnUserBuilder setAlertMethodCd(FnLuAlertMethod alertMethodCd) {
              this.alertMethodCd = alertMethodCd;
              return this;
       }

       public FnUserBuilder setHrid(@Size(max = 20) @SafeHtml String hrid) {
              this.hrid = hrid;
              return this;
       }

       public FnUserBuilder setOrgUserId(@Size(max = 20) @SafeHtml String orgUserId) {
              this.orgUserId = orgUserId;
              return this;
       }

       public FnUserBuilder setOrg_code(@Size(max = 30) @SafeHtml String org_code) {
              this.org_code = org_code;
              return this;
       }

       public FnUserBuilder setLoginId(@Size(max = 25) @SafeHtml String loginId) {
              this.loginId = loginId;
              return this;
       }

       public FnUserBuilder setLoginPwd(@Size(max = 100) @SafeHtml String loginPwd) {
              this.loginPwd = loginPwd;
              return this;
       }

       public FnUserBuilder setLastLoginDate(@PastOrPresent LocalDateTime lastLoginDate) {
              this.lastLoginDate = lastLoginDate;
              return this;
       }

       public FnUserBuilder setActiveYn(
               @Size(max = 1) @SafeHtml @NotNull(message = "activeYn must not be null") String activeYn) {
              this.activeYn = activeYn;
              return this;
       }

       public FnUserBuilder setCreatedId(@Valid FnUser createdId) {
              this.createdId = createdId;
              return this;
       }

       public FnUserBuilder setCreatedDate(@PastOrPresent LocalDateTime createdDate) {
              this.createdDate = createdDate;
              return this;
       }

       public FnUserBuilder setModifiedId(@Digits(integer = 11, fraction = 0) FnUser modifiedId) {
              this.modifiedId = modifiedId;
              return this;
       }

       public FnUserBuilder setModifiedDate(@PastOrPresent LocalDateTime modifiedDate) {
              this.modifiedDate = modifiedDate;
              return this;
       }

       public FnUserBuilder setIsInternalYn(
               @Size(max = 1) @SafeHtml @NotNull(message = "isInternalYn must not be null") String isInternalYn) {
              this.isInternalYn = isInternalYn;
              return this;
       }

       public FnUserBuilder setAddressLine1(@Size(max = 100) @SafeHtml String addressLine1) {
              this.addressLine1 = addressLine1;
              return this;
       }

       public FnUserBuilder setAddressLine2(@Size(max = 100) @SafeHtml String addressLine2) {
              this.addressLine2 = addressLine2;
              return this;
       }

       public FnUserBuilder setCity(@Size(max = 50) @SafeHtml String city) {
              this.city = city;
              return this;
       }

       public FnUserBuilder setStateCd(@Size(max = 3) @SafeHtml String stateCd) {
              this.stateCd = stateCd;
              return this;
       }

       public FnUserBuilder setZipCode(@Size(max = 11) @SafeHtml String zipCode) {
              this.zipCode = zipCode;
              return this;
       }

       public FnUserBuilder setCountryCd(@Size(max = 3) @SafeHtml String countryCd) {
              this.countryCd = countryCd;
              return this;
       }

       public FnUserBuilder setLocationClli(@Size(max = 8) @SafeHtml String locationClli) {
              this.locationClli = locationClli;
              return this;
       }

       public FnUserBuilder setOrgManagerUserId(@Size(max = 20) @SafeHtml String orgManagerUserId) {
              this.orgManagerUserId = orgManagerUserId;
              return this;
       }

       public FnUserBuilder setCompany(@Size(max = 100) @SafeHtml String company) {
              this.company = company;
              return this;
       }

       public FnUserBuilder setDepartmentName(@Size(max = 200) @SafeHtml String departmentName) {
              this.departmentName = departmentName;
              return this;
       }

       public FnUserBuilder setJobTitle(@Size(max = 100) @SafeHtml String jobTitle) {
              this.jobTitle = jobTitle;
              return this;
       }

       public FnUserBuilder setTimezone(@Valid FnLuTimezone timezone) {
              this.timezone = timezone;
              return this;
       }

       public FnUserBuilder setDepartment(@Size(max = 25) @SafeHtml String department) {
              this.department = department;
              return this;
       }

       public FnUserBuilder setBusinessUnit(@Size(max = 25) @SafeHtml String businessUnit) {
              this.businessUnit = businessUnit;
              return this;
       }

       public FnUserBuilder setBusinessUnitName(@Size(max = 100) @SafeHtml String businessUnitName) {
              this.businessUnitName = businessUnitName;
              return this;
       }

       public FnUserBuilder setCost_center(@Size(max = 25) @SafeHtml String cost_center) {
              this.cost_center = cost_center;
              return this;
       }

       public FnUserBuilder setFinLocCode(@Size(max = 10) @SafeHtml String finLocCode) {
              this.finLocCode = finLocCode;
              return this;
       }

       public FnUserBuilder setSiloStatus(@Size(max = 10) @SafeHtml String siloStatus) {
              this.siloStatus = siloStatus;
              return this;
       }

       public FnUserBuilder setLanguageId(
               @Valid @NotNull(message = "languageId must not be null") FnLanguage languageId) {
              this.languageId = languageId;
              return this;
       }

       public FnUserBuilder setGuest(@NotNull(message = "guest must not be null") boolean guest) {
              this.guest = guest;
              return this;
       }

       public FnUserBuilder setCrReportFileHistorie(Set<CrReportFileHistory> crReportFileHistorie) {
              this.crReportFileHistorie = crReportFileHistorie;
              return this;
       }

       public FnUserBuilder setFnRoles(Set<FnRole> fnRoles) {
              this.fnRoles = fnRoles;
              return this;
       }

       public FnUserBuilder setFnRoleList(Set<FnMenuFunctional> fnRoleList) {
              this.fnRoleList = fnRoleList;
              return this;
       }

       public FnUserBuilder setFnAuditLogs(Set<FnAuditLog> fnAuditLogs) {
              this.fnAuditLogs = fnAuditLogs;
              return this;
       }

       public FnUserBuilder setFnUsersCreatedId(Set<FnUser> fnUsersCreatedId) {
              this.fnUsersCreatedId = fnUsersCreatedId;
              return this;
       }

       public FnUserBuilder setFnUsersManagerId(Set<FnUser> fnUsersManagerId) {
              this.fnUsersManagerId = fnUsersManagerId;
              return this;
       }

       public FnUserBuilder setFnUsersModifiedId(Set<FnUser> fnUsersModifiedId) {
              this.fnUsersModifiedId = fnUsersModifiedId;
              return this;
       }

       public FnUserBuilder setEpUserRolesRequests(Set<EpUserRolesRequest> epUserRolesRequests) {
              this.epUserRolesRequests = epUserRolesRequests;
              return this;
       }

       public FnUserBuilder setPersUserAppSels(Set<FnPersUserAppSel> persUserAppSels) {
              this.persUserAppSels = persUserAppSels;
              return this;
       }

       public FnUserBuilder setEpWidgetCatalogParameters(Set<EpWidgetCatalogParameter> epWidgetCatalogParameters) {
              this.epWidgetCatalogParameters = epWidgetCatalogParameters;
              return this;
       }

       public FnUserBuilder setEpPersUserWidgetPlacements(Set<EpPersUserWidgetPlacement> epPersUserWidgetPlacements) {
              this.epPersUserWidgetPlacements = epPersUserWidgetPlacements;
              return this;
       }

       public FnUserBuilder setEpPersUserWidgetSels(Set<EpPersUserWidgetSel> epPersUserWidgetSels) {
              this.epPersUserWidgetSels = epPersUserWidgetSels;
              return this;
       }

       public FnUserBuilder setFnUserRoles(Set<FnUserRole> fnUserRoles) {
              this.fnUserRoles = fnUserRoles;
              return this;
       }

       public FnUserBuilder setEpUserNotifications(Set<EpUserNotification> epUserNotifications) {
              this.epUserNotifications = epUserNotifications;
              return this;
       }

       public FnUser createFnUser() {
              return new FnUser(userId, orgId, managerId, firstName, middleName, lastName, phone, fax, cellular, email,
                      addressId, alertMethodCd, hrid, orgUserId, org_code, loginId, loginPwd, lastLoginDate, activeYn,
                      createdId, createdDate, modifiedId, modifiedDate, isInternalYn, addressLine1, addressLine2, city,
                      stateCd, zipCode, countryCd, locationClli, orgManagerUserId, company, departmentName, jobTitle,
                      timezone, department, businessUnit, businessUnitName, cost_center, finLocCode, siloStatus,
                      languageId, guest, crReportFileHistorie, fnRoles, fnRoleList, fnAuditLogs, fnUsersCreatedId,
                      fnUsersManagerId, fnUsersModifiedId, epUserRolesRequests, persUserAppSels,
                      epWidgetCatalogParameters, epPersUserWidgetPlacements, epPersUserWidgetSels, fnUserRoles,
                      epUserNotifications);
       }
}