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