Added UniversalVesAdapter in the Mapper
[dcaegen2/services/mapper.git] / UniversalVesAdapter / src / main / java / org / onap / universalvesadapter / mappingconfig / MapperConfig.java
1 /*
2 * ============LICENSE_START=======================================================
3 * ONAP : DCAE
4 * ================================================================================
5 * Copyright 2018 TechMahindra
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.universalvesadapter.mappingconfig;
21
22 import java.util.HashMap;
23 import java.util.Map;
24 import java.util.Set;
25 import org.apache.commons.lang.builder.EqualsBuilder;
26 import org.apache.commons.lang.builder.HashCodeBuilder;
27 import org.apache.commons.lang.builder.ToStringBuilder;
28 import com.fasterxml.jackson.annotation.JsonAnyGetter;
29 import com.fasterxml.jackson.annotation.JsonAnySetter;
30 import com.fasterxml.jackson.annotation.JsonIgnore;
31 import com.fasterxml.jackson.annotation.JsonInclude;
32 import com.fasterxml.jackson.annotation.JsonProperty;
33 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
34
35 @JsonInclude(JsonInclude.Include.NON_NULL)
36 @JsonPropertyOrder({
37     "entries"
38 })
39 public class MapperConfig {
40
41     @JsonProperty("entries")
42     private Set<Entry> entries = null;
43     @JsonIgnore
44     private Map<String, Object> additionalProperties = new HashMap<String, Object>();
45
46     @JsonProperty("entries")
47     public Set<Entry> getEntries() {
48         return entries;
49     }
50
51     @JsonProperty("entries")
52     public void setEntries(Set<Entry> entries) {
53         this.entries = entries;
54     }
55
56     @JsonAnyGetter
57     public Map<String, Object> getAdditionalProperties() {
58         return this.additionalProperties;
59     }
60
61     @JsonAnySetter
62     public void setAdditionalProperty(String name, Object value) {
63         this.additionalProperties.put(name, value);
64     }
65
66     @Override
67     public String toString() {
68         return new ToStringBuilder(this).append("entries", entries).append("additionalProperties", additionalProperties).toString();
69     }
70
71     @Override
72     public int hashCode() {
73         return new HashCodeBuilder().append(additionalProperties).append(entries).toHashCode();
74     }
75
76     @Override
77     public boolean equals(Object other) {
78         if (other == this) {
79             return true;
80         }
81         if ((other instanceof MapperConfig) == false) {
82             return false;
83         }
84         MapperConfig rhs = ((MapperConfig) other);
85         return new EqualsBuilder().append(additionalProperties, rhs.additionalProperties).append(entries, rhs.entries).isEquals();
86     }
87
88 }