2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
26 * https://creativecommons.org/licenses/by/4.0/
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.
34 * ============LICENSE_END============================================
38 package org.onap.portalapp.portal.transport;
40 import java.io.Serializable;
42 public class ExternalAccessPerms implements Serializable, Comparable{
47 private static final long serialVersionUID = -200964838466882602L;
49 public String instance;
51 public String description;
54 public ExternalAccessPerms() {
60 public ExternalAccessPerms(String type, String instance, String action, String description) {
63 this.instance = instance;
65 this.description = description;
68 public ExternalAccessPerms(String type, String instance, String action) {
71 this.instance = instance;
79 public String getType() {
83 * @param type the type to set
85 public void setType(String type) {
89 * @return the instance
91 public String getInstance() {
95 * @param instance the instance to set
97 public void setInstance(String instance) {
98 this.instance = instance;
103 public String getAction() {
107 * @param action the action to set
109 public void setAction(String action) {
110 this.action = action;
113 public String getDescription() {
117 public void setDescription(String description) {
118 this.description = description;
123 public int compareTo(Object obj){
124 ExternalAccessPerms other = (ExternalAccessPerms)obj;
126 String c1 = getInstance();
127 String c2 = other.getInstance();
129 return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
135 public int hashCode() {
136 final int prime = 31;
138 result = prime * result + ((action == null) ? 0 : action.hashCode());
139 result = prime * result + ((description == null) ? 0 : description.hashCode());
140 result = prime * result + ((instance == null) ? 0 : instance.hashCode());
141 result = prime * result + ((type == null) ? 0 : type.hashCode());
148 public boolean equals(Object obj) {
153 if (getClass() != obj.getClass())
155 ExternalAccessPerms other = (ExternalAccessPerms) obj;
156 if (action == null) {
157 if (other.action != null)
159 } else if (!action.equals(other.action))
161 if (description == null) {
162 if (other.description != null)
164 } else if (!description.equals(other.description))
166 if (instance == null) {
167 if (other.instance != null)
169 } else if (!instance.equals(other.instance))
172 if (other.type != null)
174 } else if (!type.equals(other.type))