Reduce the number of problems in aai-common by removing unused imports
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / util / Entity.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
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.onap.aai.util;
22
23 import com.fasterxml.jackson.annotation.JsonAnyGetter;
24 import com.fasterxml.jackson.annotation.JsonAnySetter;
25 import com.fasterxml.jackson.annotation.JsonIgnore;
26 import com.fasterxml.jackson.annotation.JsonInclude;
27 import com.fasterxml.jackson.annotation.JsonProperty;
28 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
29
30 import java.util.ArrayList;
31 import java.util.HashMap;
32 import java.util.List;
33 import java.util.Map;
34
35 import javax.annotation.Generated;
36
37 import org.apache.commons.lang3.builder.EqualsBuilder;
38 import org.apache.commons.lang3.builder.HashCodeBuilder;
39 import org.apache.commons.lang3.builder.ToStringBuilder;
40
41 @JsonInclude(JsonInclude.Include.NON_NULL)
42 @Generated("org.jsonschema2pojo")
43 @JsonPropertyOrder({"equipment-role", "action", "key-value-list", "self-link"})
44 public class Entity {
45
46     @JsonProperty("equipment-role")
47     private String equipmentRole;
48     @JsonProperty("action")
49     private String action;
50     @JsonProperty("key-value-list")
51     private List<KeyValueList> keyValueList = new ArrayList<KeyValueList>();
52     @JsonProperty("self-link")
53     private String selfLink;
54     @JsonIgnore
55     private Map<String, Object> additionalProperties = new HashMap<String, Object>();
56
57     /**
58      * 
59      * @return
60      *         The equipmentRole
61      */
62     @JsonProperty("equipment-role")
63     public String getEquipmentRole() {
64         return equipmentRole;
65     }
66
67     /**
68      * 
69      * @param equipmentRole
70      *        The equipment-role
71      */
72     @JsonProperty("equipment-role")
73     public void setEquipmentRole(String equipmentRole) {
74         this.equipmentRole = equipmentRole;
75     }
76
77     public Entity withEquipmentRole(String equipmentRole) {
78         this.equipmentRole = equipmentRole;
79         return this;
80     }
81
82     /**
83      * 
84      * @return
85      *         The action
86      */
87     @JsonProperty("action")
88     public String getAction() {
89         return action;
90     }
91
92     /**
93      * 
94      * @param action
95      *        The action
96      */
97     @JsonProperty("action")
98     public void setAction(String action) {
99         this.action = action;
100     }
101
102     public Entity withAction(String action) {
103         this.action = action;
104         return this;
105     }
106
107     /**
108      * 
109      * @return
110      *         The keyValueList
111      */
112     @JsonProperty("key-value-list")
113     public List<KeyValueList> getKeyValueList() {
114         return keyValueList;
115     }
116
117     /**
118      * 
119      * @param keyValueList
120      *        The key-value-list
121      */
122     @JsonProperty("key-value-list")
123     public void setKeyValueList(List<KeyValueList> keyValueList) {
124         this.keyValueList = keyValueList;
125     }
126
127     public Entity withKeyValueList(List<KeyValueList> keyValueList) {
128         this.keyValueList = keyValueList;
129         return this;
130     }
131
132     /**
133      * 
134      * @return
135      *         The selfLink
136      */
137     @JsonProperty("self-link")
138     public String getSelfLink() {
139         return selfLink;
140     }
141
142     /**
143      * 
144      * @param selfLink
145      *        The self-link
146      */
147     @JsonProperty("self-link")
148     public void setSelfLink(String selfLink) {
149         this.selfLink = selfLink;
150     }
151
152     public Entity withSelfLink(String selfLink) {
153         this.selfLink = selfLink;
154         return this;
155     }
156
157     @Override
158     public String toString() {
159         return ToStringBuilder.reflectionToString(this);
160     }
161
162     @JsonAnyGetter
163     public Map<String, Object> getAdditionalProperties() {
164         return this.additionalProperties;
165     }
166
167     @JsonAnySetter
168     public void setAdditionalProperty(String name, Object value) {
169         this.additionalProperties.put(name, value);
170     }
171
172     public Entity withAdditionalProperty(String name, Object value) {
173         this.additionalProperties.put(name, value);
174         return this;
175     }
176
177     @Override
178     public int hashCode() {
179         return new HashCodeBuilder().append(equipmentRole).append(action).append(keyValueList).append(selfLink)
180                 .append(additionalProperties).toHashCode();
181     }
182
183     @Override
184     public boolean equals(Object other) {
185         if (other == this) {
186             return true;
187         }
188         if ((other instanceof Entity) == false) {
189             return false;
190         }
191         Entity rhs = ((Entity) other);
192         return new EqualsBuilder().append(equipmentRole, rhs.equipmentRole).append(action, rhs.action)
193                 .append(keyValueList, rhs.keyValueList).append(selfLink, rhs.selfLink)
194                 .append(additionalProperties, rhs.additionalProperties).isEquals();
195     }
196
197 }