Update the license for 2017-2018 license
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / util / KeyValueList.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 package org.onap.aai.util;
21
22 import java.util.HashMap;
23 import java.util.Map;
24 import javax.annotation.Generated;
25 import com.fasterxml.jackson.annotation.JsonAnyGetter;
26 import com.fasterxml.jackson.annotation.JsonAnySetter;
27 import com.fasterxml.jackson.annotation.JsonIgnore;
28 import com.fasterxml.jackson.annotation.JsonInclude;
29 import com.fasterxml.jackson.annotation.JsonProperty;
30 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
31 import org.apache.commons.lang.builder.EqualsBuilder;
32 import org.apache.commons.lang.builder.HashCodeBuilder;
33 import org.apache.commons.lang.builder.ToStringBuilder;
34
35 @JsonInclude(JsonInclude.Include.NON_NULL)
36 @Generated("org.jsonschema2pojo")
37 @JsonPropertyOrder({
38     "key",
39     "value"
40 })
41 public class KeyValueList {
42
43     @JsonProperty("key")
44     private String key;
45     @JsonProperty("value")
46     private String value;
47     @JsonIgnore
48     private Map<String, Object> additionalProperties = new HashMap<String, Object>();
49
50     /**
51      * 
52      * @return
53      *     The key
54      */
55     @JsonProperty("key")
56     public String getKey() {
57         return key;
58     }
59
60     /**
61      * 
62      * @param key
63      *     The key
64      */
65     @JsonProperty("key")
66     public void setKey(String key) {
67         this.key = key;
68     }
69
70     public KeyValueList withKey(String key) {
71         this.key = key;
72         return this;
73     }
74
75     /**
76      * 
77      * @return
78      *     The value
79      */
80     @JsonProperty("value")
81     public String getValue() {
82         return value;
83     }
84
85     /**
86      * 
87      * @param value
88      *     The value
89      */
90     @JsonProperty("value")
91     public void setValue(String value) {
92         this.value = value;
93     }
94
95     public KeyValueList withValue(String value) {
96         this.value = value;
97         return this;
98     }
99
100     @Override
101     public String toString() {
102         return ToStringBuilder.reflectionToString(this);
103     }
104
105     @JsonAnyGetter
106     public Map<String, Object> getAdditionalProperties() {
107         return this.additionalProperties;
108     }
109
110     @JsonAnySetter
111     public void setAdditionalProperty(String name, Object value) {
112         this.additionalProperties.put(name, value);
113     }
114
115     public KeyValueList withAdditionalProperty(String name, Object value) {
116         this.additionalProperties.put(name, value);
117         return this;
118     }
119
120     @Override
121     public int hashCode() {
122         return new HashCodeBuilder().append(key).append(value).append(additionalProperties).toHashCode();
123     }
124
125     @Override
126     public boolean equals(Object other) {
127         if (other == this) {
128             return true;
129         }
130         if ((other instanceof KeyValueList) == false) {
131             return false;
132         }
133         KeyValueList rhs = ((KeyValueList) other);
134         return new EqualsBuilder().append(key, rhs.key).append(value, rhs.value).append(additionalProperties, rhs.additionalProperties).isEquals();
135     }
136
137 }