2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
20 package org.onap.universalvesadapter.mappingconfig;
22 import java.util.HashMap;
24 import org.apache.commons.lang.builder.ToStringBuilder;
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;
32 @JsonInclude(JsonInclude.Include.NON_NULL)
41 public class Evaluation {
44 @JsonProperty("operand")
45 private String operand;
46 @JsonProperty("field")
48 @JsonProperty("value")
50 @JsonProperty("datatype")
51 private String datatype;
53 private Evaluation lhs;
55 private Evaluation rhs;
57 private Map<String, Object> additionalProperties = new HashMap<String, Object>();
59 @JsonProperty("operand")
60 public String getOperand() {
64 @JsonProperty("operand")
65 public void setOperand(String operand) {
66 this.operand = operand;
69 @JsonProperty("field")
70 public String getField() {
74 @JsonProperty("field")
75 public void setField(String field) {
79 @JsonProperty("value")
80 public String getValue() {
84 @JsonProperty("value")
85 public void setValue(String value) {
89 @JsonProperty("datatype")
90 public String getDatatype() {
94 @JsonProperty("datatype")
95 public void setDatatype(String datatype) {
96 this.datatype = datatype;
100 public Evaluation getLhs() {
105 public void setLhs(Evaluation lhs) {
110 public Evaluation getRhs() {
115 public void setRhs(Evaluation rhs) {
120 public Map<String, Object> getAdditionalProperties() {
121 return this.additionalProperties;
125 public void setAdditionalProperty(String name, Object value) {
126 this.additionalProperties.put(name, value);
130 public String toString() {
131 return new ToStringBuilder(this).append("operand", operand).append("field", field).append("value", value).append("datatype", datatype).append("lhs", lhs).append("rhs", rhs).append("additionalProperties", additionalProperties).toString();
135 public int hashCode() {
136 return new HashCodeBuilder().append(field).append(additionalProperties).append(value).append(rhs).append(datatype).append(operand).append(lhs).toHashCode();
140 public boolean equals(Object other) {
144 if ((other instanceof Evaluation) == false) {
147 Evaluation rhs = ((Evaluation) other);
148 return new EqualsBuilder().append(field, rhs.field).append(additionalProperties, rhs.additionalProperties).append(value, rhs.value).append(rhs, rhs.rhs).append(datatype, rhs.datatype).append(operand, rhs.operand).append(lhs, rhs.lhs).isEquals();
153 public int hashCode() {
154 final int prime = 31;
156 result = prime * result + ((datatype == null) ? 0 : datatype.hashCode());
157 result = prime * result + ((field == null) ? 0 : field.hashCode());
158 result = prime * result + ((lhs == null) ? 0 : lhs.hashCode());
159 result = prime * result + ((operand == null) ? 0 : operand.hashCode());
160 result = prime * result + ((rhs == null) ? 0 : rhs.hashCode());
161 result = prime * result + ((value == null) ? 0 : value.hashCode());
166 public boolean equals(Object obj) {
171 if (getClass() != obj.getClass())
173 Evaluation other = (Evaluation) obj;
174 if (datatype == null) {
175 if (other.datatype != null)
177 } else if (!datatype.equals(other.datatype))
180 if (other.field != null)
182 } else if (!field.equals(other.field))
185 if (other.lhs != null)
187 } else if (!lhs.equals(other.lhs))
189 if (operand == null) {
190 if (other.operand != null)
192 } else if (!operand.equals(other.operand))
195 if (other.rhs != null)
197 } else if (!rhs.equals(other.rhs))
200 if (other.value != null)
202 } else if (!value.equals(other.value))