2c6f3ff7b8a5bdfe7f462a615c9785f1a77ec4cb
[portal/sdk.git] /
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal SDK
4  * ===================================================================
5  * Copyright (C) 2017-2018 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.portalsdk.external.authorization.domain;
39
40 import java.io.Serializable;
41 import java.util.List;
42
43 public class ExternalAccessRole implements Serializable {
44
45         private static final long serialVersionUID = 3439986826362436339L;
46         
47         public String name;
48         private List<ExternalAccessPerms> perms;
49         public ExternalAccessRoleDescription description;
50         
51         
52         public ExternalAccessRole() {
53                 super();
54         }
55
56         public ExternalAccessRole(String name, List<ExternalAccessPerms> ecPerms, ExternalAccessRoleDescription description) {
57                 super();
58                 this.name = name;
59                 this.perms = ecPerms;
60                 this.description = description;
61         }
62         
63         public String getName() {
64                 return name;
65         }
66
67         public void setName(String name) {
68                 this.name = name;
69         }
70         
71         public List<ExternalAccessPerms> getPerms() {
72                 return perms;
73         }
74
75         public void setPerms(List<ExternalAccessPerms> perms) {
76                 this.perms = perms;
77         }
78
79         public ExternalAccessRoleDescription getDescription() {
80                 return description;
81         }
82         public void setDescription(ExternalAccessRoleDescription description) {
83                 this.description = description;
84         }
85
86         @Override
87         public int hashCode() {
88                 final int prime = 31;
89                 int result = 1;
90                 result = prime * result + ((description == null) ? 0 : description.hashCode());
91                 result = prime * result + ((name == null) ? 0 : name.hashCode());
92                 result = prime * result + ((perms == null) ? 0 : perms.hashCode());
93                 return result;
94         }
95
96         @Override
97         public boolean equals(Object obj) {
98                 if (this == obj)
99                         return true;
100                 if (obj == null)
101                         return false;
102                 if (getClass() != obj.getClass())
103                         return false;
104                 ExternalAccessRole other = (ExternalAccessRole) obj;
105                 if (description == null) {
106                         if (other.description != null)
107                                 return false;
108                 } else if (!description.equals(other.description))
109                         return false;
110                 if (name == null) {
111                         if (other.name != null)
112                                 return false;
113                 } else if (!name.equals(other.name))
114                         return false;
115                 if (perms == null) {
116                         if (other.perms != null)
117                                 return false;
118                 } else if (!perms.equals(other.perms))
119                         return false;
120                 return true;
121         }
122         
123         
124 }