Null check for ClientResponse in PolicyUril.java
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / domain / CentralRoleFunction.java
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright © 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.openecomp.portalapp.portal.domain;
39
40 import org.openecomp.portalsdk.core.domain.support.DomainVo;
41
42 import com.fasterxml.jackson.annotation.JsonIgnore;
43
44 @SuppressWarnings("rawtypes")
45 public class CentralRoleFunction extends DomainVo implements java.io.Serializable, Comparable {
46
47         /**
48         * 
49         */
50         private static final long serialVersionUID = -4018975640065252688L;
51         private String code;
52         private String name;
53         @JsonIgnore
54         private Long appId;
55         @JsonIgnore
56         private Long roleId;
57         private String editUrl;
58
59         public CentralRoleFunction() {
60
61         }
62
63         public CentralRoleFunction(Long id, String code, String name, Long appId, String editUrl) {
64                 super();
65                 this.id = id;
66                 this.code = code;
67                 this.name = name;
68                 this.appId = appId;
69                 this.editUrl = editUrl;
70         }
71
72         public CentralRoleFunction(String code, String name) {
73                 super();
74                 this.code = code;
75                 this.name = name;
76         }
77
78         /**
79          * @return the code
80          */
81         public String getCode() {
82                 return code;
83         }
84
85         /**
86          * @param code
87          *            the code to set
88          */
89         public void setCode(String code) {
90                 this.code = code;
91         }
92
93         /**
94          * @return the name
95          */
96         public String getName() {
97                 return name;
98         }
99
100         /**
101          * @param name
102          *            the name to set
103          */
104         public void setName(String name) {
105                 this.name = name;
106         }
107
108         /**
109          * @return the appId
110          */
111         public Long getAppId() {
112                 return appId;
113         }
114
115         /**
116          * @param appId
117          *            the appId to set
118          */
119         public void setAppId(Long appId) {
120                 this.appId = appId;
121         }
122
123         /**
124          * @return the editUrl
125          */
126         public String getEditUrl() {
127                 return editUrl;
128         }
129
130         /**
131          * @param editUrl
132          *            the editUrl to set
133          */
134         public void setEditUrl(String editUrl) {
135                 this.editUrl = editUrl;
136         }
137
138         public int compareTo(Object obj) {
139                 String c1 = getName();
140                 String c2 = ((CentralRoleFunction) obj).getName();
141
142                 return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
143         }
144
145 }