Drop AUX cluster pod list from Platform status
[portal/ric-dashboard.git] / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / model / RicInstanceKeyName.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 AT&T Intellectual Property
6  * %%
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ========================LICENSE_END===================================
19  */
20
21 package org.oransc.ric.portal.dashboard.model;
22
23 import java.util.Objects;
24
25 /**
26  * Transport model for RIC instance key-name pairs.
27  */
28 public class RicInstanceKeyName implements IDashboardResponse {
29
30         private String key;
31         private String name;
32
33         /**
34          * Builds an empty object.
35          */
36         public RicInstanceKeyName() {
37                 // no-arg constructor
38         }
39
40         /**
41          * Convenience constructor for minimal value set.
42          * 
43          * @param key
44          *                 Key
45          * @param name
46          *                 Name
47          */
48         public RicInstanceKeyName(String key, String name) {
49                 this.key = key;
50                 this.name = name;
51         }
52
53         public String getKey() {
54                 return key;
55         }
56
57         public void setKey(String key) {
58                 this.key = key;
59         }
60
61         public RicInstanceKeyName key(String key) {
62                 this.key = key;
63                 return this;
64         }
65
66         public String getName() {
67                 return name;
68         }
69
70         public void setName(String s) {
71                 this.name = s;
72         }
73
74         public RicInstanceKeyName name(String name) {
75                 this.name = name;
76                 return this;
77         }
78
79         @Override
80         public String toString() {
81                 return this.getClass().getName() + "[key=" + getKey() + ", name=" + getName() + "]";
82         }
83
84         @Override
85         public int hashCode() {
86                 final int prime = 31;
87                 int result = 1;
88                 result = prime * result + ((key == null) ? 0 : key.hashCode());
89                 result = prime * result + ((name == null) ? 0 : name.hashCode());
90                 return result;
91         }
92
93         @Override
94         public boolean equals(Object obj) {
95                 if (this == obj)
96                         return true;
97                 if (obj == null)
98                         return false;
99                 if (getClass() != obj.getClass())
100                         return false;
101                 RicInstanceKeyName other = (RicInstanceKeyName) obj;
102                 return Objects.equals(key, other.key);
103         }
104
105 }