Merge "Junit for RestObject scheduler"
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / transport / CentralRole.java
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the "License");
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * 
37  */
38 package org.onap.portalapp.portal.transport;
39
40 import java.io.Serializable;
41 import java.util.Date;
42 import java.util.SortedSet;
43 import java.util.TreeSet;
44
45 public class CentralRole implements Serializable {
46
47         private static final long serialVersionUID = -9210905386086213882L;
48         private Long id;
49         private Date created;
50         private Date modified;
51         private Long createdId;
52         private Long modifiedId;
53         private Long rowNum;
54
55         private String name;
56         private boolean active;
57         private Integer priority;
58
59         private SortedSet<CentralRoleFunction> roleFunctions = new TreeSet<>();
60
61         private SortedSet<CentralRole> childRoles = new TreeSet<>();
62
63         private SortedSet<CentralRole> parentRoles = new TreeSet<>();
64
65         public CentralRole(){
66                 
67         }
68         
69         public CentralRole(Long id, String name, boolean active, Integer priority,
70                         SortedSet<CentralRoleFunction> roleFunctions) {
71                 super();
72                 this.id = id;
73                 this.name = name;
74                 this.active = active;
75                 this.priority = priority;
76                 this.roleFunctions = roleFunctions;
77         }
78         
79         public static class CentralRoleBuilder {
80             private Long id;
81             private String name;
82             private boolean active;
83             private Integer priority;
84             private SortedSet<CentralRoleFunction> roleFunctions;
85             private Date created;
86             private Date modified;
87             private Long createdId;
88             private Long modifiedId;
89             private Long rowNum;
90             private SortedSet<CentralRole> childRoles;
91             private SortedSet<CentralRole> parentRoles;
92
93             public CentralRoleBuilder setId(Long id) {
94                 this.id = id;
95                 return this;
96             }
97
98             public CentralRoleBuilder setName(String name) {
99                 this.name = name;
100                 return this;
101             }
102
103             public CentralRoleBuilder setActive(boolean active) {
104                 this.active = active;
105                 return this;
106             }
107
108             public CentralRoleBuilder setPriority(Integer priority) {
109                 this.priority = priority;
110                 return this;
111             }
112
113             public CentralRoleBuilder setRoleFunctions(SortedSet<CentralRoleFunction> roleFunctions) {
114                 this.roleFunctions = roleFunctions;
115                 return this;
116             }
117
118             public CentralRoleBuilder setCreated(Date created) {
119                 this.created = created;
120                 return this;
121             }
122
123             public CentralRoleBuilder setModified(Date modified) {
124                 this.modified = modified;
125                 return this;
126             }
127
128             public CentralRoleBuilder setCreatedId(Long createdId) {
129                 this.createdId = createdId;
130                 return this;
131             }
132
133             public CentralRoleBuilder setModifiedId(Long modifiedId) {
134                 this.modifiedId = modifiedId;
135                 return this;
136             }
137
138             public CentralRoleBuilder setRowNum(Long rowNum) {
139                 this.rowNum = rowNum;
140                 return this;
141             }
142
143             public CentralRoleBuilder setChildRoles(SortedSet<CentralRole> childRoles) {
144                 this.childRoles = childRoles;
145                 return this;
146             }
147
148             public CentralRoleBuilder setParentRoles(SortedSet<CentralRole> parentRoles) {
149                 this.parentRoles = parentRoles;
150                 return this;
151             }
152
153             public CentralRole createCentralRole() {
154                 return new CentralRole(this);
155             }
156         }
157
158         public CentralRole(CentralRoleBuilder centralRoleBuilder) {
159                 super();
160                 this.id = centralRoleBuilder.id;
161                 this.created = centralRoleBuilder.created;
162                 this.modified = centralRoleBuilder.modified;
163                 this.createdId = centralRoleBuilder.createdId;
164                 this.modifiedId = centralRoleBuilder.modifiedId;
165                 this.rowNum = centralRoleBuilder.rowNum;
166                 this.name = centralRoleBuilder.name;
167                 this.active = centralRoleBuilder.active;
168                 this.priority = centralRoleBuilder.priority;
169                 this.roleFunctions = centralRoleBuilder.roleFunctions;
170                 this.childRoles = centralRoleBuilder.childRoles;
171                 this.parentRoles = centralRoleBuilder.parentRoles;
172         }
173
174         /**
175          * @return the id
176          */
177         public Long getId() {
178                 return id;
179         }
180
181         /**
182          * @param id
183          *            the id to set
184          */
185         public void setId(Long id) {
186                 this.id = id;
187         }
188
189         /**
190          * @return the created
191          */
192         public Date getCreated() {
193                 return created;
194         }
195
196         /**
197          * @param created
198          *            the created to set
199          */
200         public void setCreated(Date created) {
201                 this.created = created;
202         }
203
204         /**
205          * @return the modified
206          */
207         public Date getModified() {
208                 return modified;
209         }
210
211         /**
212          * @param modified
213          *            the modified to set
214          */
215         public void setModified(Date modified) {
216                 this.modified = modified;
217         }
218
219         /**
220          * @return the createdId
221          */
222         public Long getCreatedId() {
223                 return createdId;
224         }
225
226         /**
227          * @param createdId
228          *            the createdId to set
229          */
230         public void setCreatedId(Long createdId) {
231                 this.createdId = createdId;
232         }
233
234         /**
235          * @return the modifiedId
236          */
237         public Long getModifiedId() {
238                 return modifiedId;
239         }
240
241         /**
242          * @param modifiedId
243          *            the modifiedId to set
244          */
245         public void setModifiedId(Long modifiedId) {
246                 this.modifiedId = modifiedId;
247         }
248
249         /**
250          * @return the rowNum
251          */
252         public Long getRowNum() {
253                 return rowNum;
254         }
255
256         /**
257          * @param rowNum
258          *            the rowNum to set
259          */
260         public void setRowNum(Long rowNum) {
261                 this.rowNum = rowNum;
262         }
263
264         /**
265          * @return the name
266          */
267         public String getName() {
268                 return name;
269         }
270
271         /**
272          * @param name
273          *            the name to set
274          */
275         public void setName(String name) {
276                 this.name = name;
277         }
278
279         /**
280          * @return the active
281          */
282         public boolean isActive() {
283                 return active;
284         }
285
286         /**
287          * @param active
288          *            the active to set
289          */
290         public void setActive(boolean active) {
291                 this.active = active;
292         }
293
294         /**
295          * @return the priority
296          */
297         public Integer getPriority() {
298                 return priority;
299         }
300
301         /**
302          * @param priority
303          *            the priority to set
304          */
305         public void setPriority(Integer priority) {
306                 this.priority = priority;
307         }
308
309         /**
310          * @return the roleFunctions
311          */
312         public SortedSet<CentralRoleFunction> getRoleFunctions() {
313                 return roleFunctions;
314         }
315
316         /**
317          * @param roleFunctions
318          *            the roleFunctions to set
319          */
320         public void setRoleFunctions(SortedSet<CentralRoleFunction> roleFunctions) {
321                 this.roleFunctions = roleFunctions;
322         }
323
324         /**
325          * @return the childRoles
326          */
327         public SortedSet<CentralRole> getChildRoles() {
328                 return childRoles;
329         }
330
331         /**
332          * @param childRoles
333          *            the childRoles to set
334          */
335         public void setChildRoles(SortedSet<CentralRole> childRoles) {
336                 this.childRoles = childRoles;
337         }
338
339         /**
340          * @return the parentRoles
341          */
342         public SortedSet<CentralRole> getParentRoles() {
343                 return parentRoles;
344         }
345
346         /**
347          * @param parentRoles
348          *            the parentRoles to set
349          */
350         public void setParentRoles(SortedSet<CentralRole> parentRoles) {
351                 this.parentRoles = parentRoles;
352         }
353
354 }