revert the changes
[so.git] / so-monitoring / so-monitoring-handler / src / main / java / org / onap / so / monitoring / camunda / model / ActivityInstance.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2018 Ericsson. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  * 
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  * 
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * 
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20 package org.onap.so.monitoring.camunda.model;
21
22 import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
23
24 import com.fasterxml.jackson.annotation.JsonIgnore;
25 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
26
27 /**
28  * @author waqas.ikram@ericsson.com
29  *
30  */
31 @JsonIgnoreProperties(ignoreUnknown = true)
32 public class ActivityInstance {
33
34     private String activityId;
35     private String activityName;
36     private String activityType;
37     private String processInstanceId;
38     private String calledProcessInstanceId;
39     private String startTime;
40     private String endTime;
41     private String durationInMillis;
42
43     public ActivityInstance() {}
44
45
46     /**
47      * @return the activityId
48      */
49     public String getActivityId() {
50         return activityId;
51     }
52
53     /**
54      * @param activityId the activityId to set
55      */
56     public void setActivityId(final String activityId) {
57         this.activityId = activityId;
58     }
59
60     /**
61      * @return the activityName
62      */
63     public String getActivityName() {
64         return activityName;
65     }
66
67     /**
68      * @param activityName the activityName to set
69      */
70     public void setActivityName(final String activityName) {
71         this.activityName = activityName;
72     }
73
74     /**
75      * @return the activityType
76      */
77     public String getActivityType() {
78         return activityType;
79     }
80
81     /**
82      * @param activityType the activityType to set
83      */
84     public void setActivityType(final String activityType) {
85         this.activityType = activityType;
86     }
87
88     /**
89      * @return the processInstanceId
90      */
91     public String getProcessInstanceId() {
92         return processInstanceId;
93     }
94
95     /**
96      * @param processInstanceId the processInstanceId to set
97      */
98     public void setProcessInstanceId(final String processInstanceId) {
99         this.processInstanceId = processInstanceId;
100     }
101
102     /**
103      * @return the calledProcessInstanceId
104      */
105     public String getCalledProcessInstanceId() {
106         return calledProcessInstanceId;
107     }
108
109     /**
110      * @param calledProcessInstanceId the calledProcessInstanceId to set
111      */
112     public void setCalledProcessInstanceId(final String calledProcessInstanceId) {
113         this.calledProcessInstanceId = calledProcessInstanceId;
114     }
115
116     /**
117      * @return the startTime
118      */
119     public String getStartTime() {
120         return startTime;
121     }
122
123     /**
124      * @param startTime the startTime to set
125      */
126     public void setStartTime(final String startTime) {
127         this.startTime = startTime;
128     }
129
130     /**
131      * @return the endTime
132      */
133     public String getEndTime() {
134         return endTime;
135     }
136
137     /**
138      * @param endTime the endTime to set
139      */
140     public void setEndTime(final String endTime) {
141         this.endTime = endTime;
142     }
143
144     /**
145      * @return the durationInMillis
146      */
147     public String getDurationInMillis() {
148         return durationInMillis;
149     }
150
151     /**
152      * @param durationInMillis the durationInMillis to set
153      */
154     public void setDurationInMillis(final String durationInMillis) {
155         this.durationInMillis = durationInMillis;
156     }
157
158     @JsonIgnore
159     @Override
160     public int hashCode() {
161         final int prime = 31;
162         int result = 1;
163         result = prime * result + ((activityId == null) ? 0 : activityId.hashCode());
164         result = prime * result + ((activityName == null) ? 0 : activityName.hashCode());
165         result = prime * result + ((activityType == null) ? 0 : activityType.hashCode());
166         result = prime * result + ((calledProcessInstanceId == null) ? 0 : calledProcessInstanceId.hashCode());
167         result = prime * result + ((durationInMillis == null) ? 0 : durationInMillis.hashCode());
168         result = prime * result + ((endTime == null) ? 0 : endTime.hashCode());
169         result = prime * result + ((processInstanceId == null) ? 0 : processInstanceId.hashCode());
170         result = prime * result + ((startTime == null) ? 0 : startTime.hashCode());
171         return result;
172     }
173
174     @JsonIgnore
175     @Override
176     public boolean equals(final Object obj) {
177         if (obj instanceof ActivityInstance) {
178             final ActivityInstance other = (ActivityInstance) obj;
179             return isEqual(activityId, other.activityId) && isEqual(activityName, other.activityName)
180                     && isEqual(activityType, other.activityType) && isEqual(processInstanceId, other.processInstanceId)
181                     && isEqual(calledProcessInstanceId, other.calledProcessInstanceId)
182                     && isEqual(startTime, other.startTime) && isEqual(endTime, other.endTime)
183                     && isEqual(durationInMillis, other.durationInMillis);
184         }
185         return false;
186     }
187     
188 }