Security/ Package Name changes
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / transport / CentralRoleFunction.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  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38 package org.onap.portalapp.portal.transport;
39
40 import java.io.Serializable;
41 import java.util.Date;
42 import java.util.Set;
43
44 @SuppressWarnings("rawtypes")
45 public class CentralRoleFunction implements Serializable, Comparable {
46         private static final long serialVersionUID = 1990254299529285610L;
47         private Long id;
48         private Date created;
49         private Date modified;
50         private Long createdId;
51         private Long modifiedId;
52         private Serializable auditUserId;
53         private Set auditTrail;
54         private Long rowNum;
55         private String code;
56         private String name;
57         private String editUrl;
58
59         public CentralRoleFunction(String code, String name) {
60                 super();
61                 this.code = code;
62                 this.name = name;
63         }
64
65         public CentralRoleFunction() {
66         }
67
68         /**
69          * @return the id
70          */
71         public Long getId() {
72                 return id;
73         }
74
75         /**
76          * @param id
77          *            the id to set
78          */
79         public void setId(Long id) {
80                 this.id = id;
81         }
82
83         /**
84          * @return the created
85          */
86         public Date getCreated() {
87                 return created;
88         }
89
90         /**
91          * @param created
92          *            the created to set
93          */
94         public void setCreated(Date created) {
95                 this.created = created;
96         }
97
98         /**
99          * @return the modified
100          */
101         public Date getModified() {
102                 return modified;
103         }
104
105         /**
106          * @param modified
107          *            the modified to set
108          */
109         public void setModified(Date modified) {
110                 this.modified = modified;
111         }
112
113         /**
114          * @return the createdId
115          */
116         public Long getCreatedId() {
117                 return createdId;
118         }
119
120         /**
121          * @param createdId
122          *            the createdId to set
123          */
124         public void setCreatedId(Long createdId) {
125                 this.createdId = createdId;
126         }
127
128         /**
129          * @return the modifiedId
130          */
131         public Long getModifiedId() {
132                 return modifiedId;
133         }
134
135         /**
136          * @param modifiedId
137          *            the modifiedId to set
138          */
139         public void setModifiedId(Long modifiedId) {
140                 this.modifiedId = modifiedId;
141         }
142
143         /**
144          * @return the rowNum
145          */
146         public Long getRowNum() {
147                 return rowNum;
148         }
149
150         /**
151          * @param rowNum
152          *            the rowNum to set
153          */
154         public void setRowNum(Long rowNum) {
155                 this.rowNum = rowNum;
156         }
157
158         /**
159          * @return the code
160          */
161         public String getCode() {
162                 return code;
163         }
164
165         /**
166          * @param code
167          *            the code to set
168          */
169         public void setCode(String code) {
170                 this.code = code;
171         }
172
173         /**
174          * @return the name
175          */
176         public String getName() {
177                 return name;
178         }
179
180         /**
181          * @param name
182          *            the name to set
183          */
184         public void setName(String name) {
185                 this.name = name;
186         }
187
188         public Serializable getAuditUserId() {
189                 return auditUserId;
190         }
191
192         public void setAuditUserId(Serializable auditUserId) {
193                 this.auditUserId = auditUserId;
194         }
195
196         public Set getAuditTrail() {
197                 return auditTrail;
198         }
199
200         public void setAuditTrail(Set auditTrail) {
201                 this.auditTrail = auditTrail;
202         }
203
204         public String getEditUrl() {
205                 return editUrl;
206         }
207
208         public void setEditUrl(String editUrl) {
209                 this.editUrl = editUrl;
210         }
211
212         @Override
213         public int compareTo(Object obj) {
214                 String c1 = getName();
215                 String c2 = ((CentralRoleFunction) obj).getName();
216
217                 return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
218         }
219
220         @Override
221         public int hashCode() {
222                 final int prime = 31;
223                 int result = 1;
224                 result = prime * result + ((code == null) ? 0 : code.hashCode());
225                 result = prime * result + ((name == null) ? 0 : name.hashCode());
226                 return result;
227         }
228
229         @Override
230         public boolean equals(Object obj) {
231                 if (this == obj)
232                         return true;
233                 if (obj == null)
234                         return false;
235                 if (getClass() != obj.getClass())
236                         return false;
237                 CentralRoleFunction other = (CentralRoleFunction) obj;
238                 if (code == null) {
239                         if (other.code != null)
240                                 return false;
241                 } else if (!code.equals(other.code))
242                         return false;
243                 if (name == null) {
244                         if (other.name != null)
245                                 return false;
246                 } else if (!name.equals(other.name))
247                         return false;
248                 return true;
249         }
250
251 }