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.dcaegen2.ves.domain;
22 import java.util.HashMap;
24 import org.apache.commons.lang.builder.EqualsBuilder;
25 import org.apache.commons.lang.builder.HashCodeBuilder;
26 import org.apache.commons.lang.builder.ToStringBuilder;
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)
40 @JsonProperty("commonEventHeader")
41 private CommonEventHeader commonEventHeader;
42 @JsonProperty("faultFields")
43 private FaultFields faultFields;
44 @JsonProperty("heartbeatFields")
45 private HeartbeatFields heartbeatFields;
48 private Map<String, Object> additionalProperties = new HashMap<String, Object>();
50 @JsonProperty("commonEventHeader")
51 public CommonEventHeader getCommonEventHeader() {
52 return commonEventHeader;
55 @JsonProperty("commonEventHeader")
56 public void setCommonEventHeader(CommonEventHeader commonEventHeader) {
57 this.commonEventHeader = commonEventHeader;
60 @JsonProperty("faultFields")
61 public FaultFields getFaultFields() {
65 @JsonProperty("faultFields")
66 public void setFaultFields(FaultFields faultFields) {
67 this.faultFields = faultFields;
70 @JsonProperty("heartbeatFields")
71 public HeartbeatFields getHeartbeatFields() {
72 return heartbeatFields;
75 @JsonProperty("heartbeatFields")
76 public void setHeartbeatFields(HeartbeatFields heartbeatFields) {
77 this.heartbeatFields = heartbeatFields;
82 public String toString() {
83 return new ToStringBuilder(this).append("commonEventHeader", commonEventHeader).append("faultFields", faultFields).append("heartbeatFields", heartbeatFields).toString();
87 public int hashCode() {
88 return new HashCodeBuilder().append(heartbeatFields).append(commonEventHeader).append(additionalProperties).append(faultFields).toHashCode(); }
91 public boolean equals(Object other) {
95 if ((other instanceof Event) == false) {
98 Event rhs = ((Event) other);
99 return new EqualsBuilder().append(heartbeatFields, rhs.heartbeatFields).append(commonEventHeader, rhs.commonEventHeader).append(additionalProperties, rhs.additionalProperties).append(faultFields, rhs.faultFields).isEquals();