Merge "MicroserviceParameter class DB constraints"
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / domain / CentralV2RoleFunction.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.domain;
39
40 import java.io.Serializable;
41
42 import org.hibernate.validator.constraints.SafeHtml;
43 import org.onap.portalsdk.core.domain.support.DomainVo;
44
45 import com.fasterxml.jackson.annotation.JsonIgnore;
46  
47 @SuppressWarnings("rawtypes")
48 public class CentralV2RoleFunction extends DomainVo implements Serializable, Comparable{
49         
50            /**
51          * 
52          */
53         private static final long serialVersionUID = -4018975640065252688L;
54                 @SafeHtml
55            private String code;
56                 @SafeHtml
57            private String name;
58            @JsonIgnore
59            private Long appId;
60            @JsonIgnore
61            private Long roleId;
62            private String type;
63            @SafeHtml
64            private String action;
65            @SafeHtml
66            private String editUrl;
67            
68            
69         public CentralV2RoleFunction() {
70         
71         }
72         
73         
74         public CentralV2RoleFunction(Long id, String code, String name, Long appId, String type, String action,String editUrl) {
75                 super();
76                 this.id = id;
77                 this.code = code;
78                 this.name = name;
79                 this.appId = appId;
80                 this.type = type;
81                 this.action = action;
82                 this.editUrl = editUrl;
83         }
84         
85         public CentralV2RoleFunction(Long id, String code, String name, Long appId,String editUrl) {
86                 super();
87                 this.id = id;
88                 this.code = code;
89                 this.name = name;
90                 this.appId = appId;
91                 this.editUrl = editUrl;
92         }
93         
94         
95
96         public CentralV2RoleFunction(String code, String name) {
97                 super();
98                 this.code = code;
99                 this.name = name;
100         }
101
102         /**
103          * @return the code
104          */
105         public String getCode() {
106                 return code;
107         }
108         /**
109          * @param code the code to set
110          */
111         public void setCode(String code) {
112                 this.code = code;
113         }
114         /**
115          * @return the name
116          */
117         public String getName() {
118                 return name;
119         }
120         /**
121          * @param name the name to set
122          */
123         public void setName(String name) {
124                 this.name = name;
125         }
126         /**
127          * @return the appId
128          */
129         public Long getAppId() {
130                 return appId;
131         }
132         /**
133          * @param appId the appId to set
134          */
135         public void setAppId(Long appId) {
136                 this.appId = appId;
137         }
138         /**
139          * @return the editUrl
140          */
141         public String getEditUrl() {
142                 return editUrl;
143         }
144         /**
145          * @param editUrl the editUrl to set
146          */
147         public void setEditUrl(String editUrl) {
148                 this.editUrl = editUrl;
149         }
150         
151         
152     /**
153          * @return the type
154          */
155         public String getType() {
156                 return type;
157         }
158
159
160         /**
161          * @param type the type to set
162          */
163         public void setType(String type) {
164                 this.type = type;
165         }
166
167
168         /**
169          * @return the action
170          */
171         public String getAction() {
172                 return action;
173         }
174
175
176         /**
177          * @param action the action to set
178          */
179         public void setAction(String action) {
180                 this.action = action;
181         }
182
183
184         public int compareTo(Object obj){
185         String c1 = getName();
186         String c2 = ((CentralV2RoleFunction)obj).getName();
187
188         return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
189       }
190         
191         
192    
193 }