Deliver centralized role management feature
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / transport / CentralRole.java
1 package org.openecomp.portalapp.portal.transport;
2
3 import java.util.Date;
4 import java.util.SortedSet;
5
6 import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
7 import org.openecomp.portalapp.portal.domain.EPRole;
8
9 public class CentralRole implements Comparable{
10                 public Long id;
11                 public Date created;
12                 public Date modified;
13                 public Long createdId;
14                 public Long modifiedId;
15                 public Long rowNum;
16                 
17             public String  name;
18             public boolean active;
19             public Integer priority;
20             
21             public SortedSet<CentralRoleFunction> roleFunctions = null;
22             
23             public SortedSet<CentralRole> childRoles = null;
24
25             public SortedSet<CentralRole> parentRoles = null;
26
27                 public CentralRole(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum,
28                                 String name, boolean active, Integer priority, SortedSet<CentralRoleFunction> roleFunctions,
29                                 SortedSet<CentralRole> childRoles, SortedSet<CentralRole> parentRoles) {
30                         super();
31                         this.id = id;
32                         this.created = created;
33                         this.modified = modified;
34                         this.createdId = createdId;
35                         this.modifiedId = modifiedId;
36                         this.rowNum = rowNum;
37                         this.name = name;
38                         this.active = active;
39                         this.priority = priority;
40                         this.roleFunctions = roleFunctions;
41                         this.childRoles = childRoles;
42                         this.parentRoles = parentRoles;
43                 }
44                 
45                 public CentralRole(){
46                         
47                 }
48                 
49                 public CentralRole(Long id, String name){
50                         this.id = id;
51                         this.name = name;
52                 }
53
54                 public Long getId() {
55                         return id;
56                 }
57
58                 public void setId(Long id) {
59                         this.id = id;
60                 }
61
62                 public Date getCreated() {
63                         return created;
64                 }
65
66                 public void setCreated(Date created) {
67                         this.created = created;
68                 }
69
70                 public Date getModified() {
71                         return modified;
72                 }
73
74                 public void setModified(Date modified) {
75                         this.modified = modified;
76                 }
77
78                 public Long getCreatedId() {
79                         return createdId;
80                 }
81
82                 public void setCreatedId(Long createdId) {
83                         this.createdId = createdId;
84                 }
85
86                 public Long getModifiedId() {
87                         return modifiedId;
88                 }
89
90                 public void setModifiedId(Long modifiedId) {
91                         this.modifiedId = modifiedId;
92                 }
93
94                 public Long getRowNum() {
95                         return rowNum;
96                 }
97
98                 public void setRowNum(Long rowNum) {
99                         this.rowNum = rowNum;
100                 }
101
102                 public String getName() {
103                         return name;
104                 }
105
106                 public void setName(String name) {
107                         this.name = name;
108                 }
109
110                 public boolean isActive() {
111                         return active;
112                 }
113
114                 public void setActive(boolean active) {
115                         this.active = active;
116                 }
117
118                 public Integer getPriority() {
119                         return priority;
120                 }
121
122                 public void setPriority(Integer priority) {
123                         this.priority = priority;
124                 }
125
126                 public SortedSet<CentralRoleFunction> getRoleFunctions() {
127                         return roleFunctions;
128                 }
129
130                 public void setRoleFunctions(SortedSet<CentralRoleFunction> roleFunctions) {
131                         this.roleFunctions = roleFunctions;
132                 }
133
134                 public SortedSet<CentralRole> getChildRoles() {
135                         return childRoles;
136                 }
137
138                 public void setChildRoles(SortedSet<CentralRole> childRoles) {
139                         this.childRoles = childRoles;
140                 }
141
142                 public SortedSet<CentralRole> getParentRoles() {
143                         return parentRoles;
144                 }
145
146                 public void setParentRoles(SortedSet<CentralRole> parentRoles) {
147                         this.parentRoles = parentRoles;
148                 }
149                 
150                 public int compareTo(Object obj){
151                 EPRole other = (EPRole)obj;
152
153                 String c1 = getName();
154                 String c2 = other.getName();
155
156                 return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
157             }
158
159 }