Added UniversalVesAdapter in the Mapper
[dcaegen2/services/mapper.git] / UniversalVesAdapter / src / main / java / org / onap / dcaegen2 / ves / domain / Event.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.dcaegen2.ves.domain;
21
22 import java.util.HashMap;
23 import java.util.Map;
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;
31
32 @JsonInclude(JsonInclude.Include.NON_NULL)
33 @JsonPropertyOrder({
34     "commonEventHeader",
35     "faultFields",
36     "heartbeatFields"
37 })
38 public class Event {
39
40     @JsonProperty("commonEventHeader")
41     private CommonEventHeader commonEventHeader;
42     @JsonProperty("faultFields")
43     private FaultFields faultFields;
44     @JsonProperty("heartbeatFields")
45     private HeartbeatFields heartbeatFields;
46   
47     @JsonIgnore
48     private Map<String, Object> additionalProperties = new HashMap<String, Object>();
49
50     @JsonProperty("commonEventHeader")
51     public CommonEventHeader getCommonEventHeader() {
52         return commonEventHeader;
53     }
54
55     @JsonProperty("commonEventHeader")
56     public void setCommonEventHeader(CommonEventHeader commonEventHeader) {
57         this.commonEventHeader = commonEventHeader;
58     }
59
60     @JsonProperty("faultFields")
61     public FaultFields getFaultFields() {
62         return faultFields;
63     }
64
65     @JsonProperty("faultFields")
66     public void setFaultFields(FaultFields faultFields) {
67         this.faultFields = faultFields;
68     }
69
70     @JsonProperty("heartbeatFields")
71     public HeartbeatFields getHeartbeatFields() {
72         return heartbeatFields;
73     }
74
75     @JsonProperty("heartbeatFields")
76     public void setHeartbeatFields(HeartbeatFields heartbeatFields) {
77         this.heartbeatFields = heartbeatFields;
78     }
79
80   
81     @Override
82     public String toString() {
83         return new ToStringBuilder(this).append("commonEventHeader", commonEventHeader).append("faultFields", faultFields).append("heartbeatFields", heartbeatFields).toString();
84     }
85
86     @Override
87     public int hashCode() {
88          return new HashCodeBuilder().append(heartbeatFields).append(commonEventHeader).append(additionalProperties).append(faultFields).toHashCode();    }
89
90     @Override
91     public boolean equals(Object other) {
92         if (other == this) {
93             return true;
94         }
95         if ((other instanceof Event) == false) {
96             return false;
97         }
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();
100     }
101
102 }