Remove mso-oof-adapter from SO
[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 import com.fasterxml.jackson.annotation.JsonIgnore;
24 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
25
26 /**
27  * @author waqas.ikram@ericsson.com
28  *
29  */
30 @JsonIgnoreProperties(ignoreUnknown = true)
31 public class ActivityInstance {
32
33     private String activityId;
34     private String activityName;
35     private String activityType;
36     private String processInstanceId;
37     private String calledProcessInstanceId;
38     private String startTime;
39     private String endTime;
40     private String durationInMillis;
41
42     public ActivityInstance() {}
43
44
45     /**
46      * @return the activityId
47      */
48     public String getActivityId() {
49         return activityId;
50     }
51
52     /**
53      * @param activityId the activityId to set
54      */
55     public void setActivityId(final String activityId) {
56         this.activityId = activityId;
57     }
58
59     /**
60      * @return the activityName
61      */
62     public String getActivityName() {
63         return activityName;
64     }
65
66     /**
67      * @param activityName the activityName to set
68      */
69     public void setActivityName(final String activityName) {
70         this.activityName = activityName;
71     }
72
73     /**
74      * @return the activityType
75      */
76     public String getActivityType() {
77         return activityType;
78     }
79
80     /**
81      * @param activityType the activityType to set
82      */
83     public void setActivityType(final String activityType) {
84         this.activityType = activityType;
85     }
86
87     /**
88      * @return the processInstanceId
89      */
90     public String getProcessInstanceId() {
91         return processInstanceId;
92     }
93
94     /**
95      * @param processInstanceId the processInstanceId to set
96      */
97     public void setProcessInstanceId(final String processInstanceId) {
98         this.processInstanceId = processInstanceId;
99     }
100
101     /**
102      * @return the calledProcessInstanceId
103      */
104     public String getCalledProcessInstanceId() {
105         return calledProcessInstanceId;
106     }
107
108     /**
109      * @param calledProcessInstanceId the calledProcessInstanceId to set
110      */
111     public void setCalledProcessInstanceId(final String calledProcessInstanceId) {
112         this.calledProcessInstanceId = calledProcessInstanceId;
113     }
114
115     /**
116      * @return the startTime
117      */
118     public String getStartTime() {
119         return startTime;
120     }
121
122     /**
123      * @param startTime the startTime to set
124      */
125     public void setStartTime(final String startTime) {
126         this.startTime = startTime;
127     }
128
129     /**
130      * @return the endTime
131      */
132     public String getEndTime() {
133         return endTime;
134     }
135
136     /**
137      * @param endTime the endTime to set
138      */
139     public void setEndTime(final String endTime) {
140         this.endTime = endTime;
141     }
142
143     /**
144      * @return the durationInMillis
145      */
146     public String getDurationInMillis() {
147         return durationInMillis;
148     }
149
150     /**
151      * @param durationInMillis the durationInMillis to set
152      */
153     public void setDurationInMillis(final String durationInMillis) {
154         this.durationInMillis = durationInMillis;
155     }
156
157     @JsonIgnore
158     @Override
159     public int hashCode() {
160         final int prime = 31;
161         int result = 1;
162         result = prime * result + ((activityId == null) ? 0 : activityId.hashCode());
163         result = prime * result + ((activityName == null) ? 0 : activityName.hashCode());
164         result = prime * result + ((activityType == null) ? 0 : activityType.hashCode());
165         result = prime * result + ((calledProcessInstanceId == null) ? 0 : calledProcessInstanceId.hashCode());
166         result = prime * result + ((durationInMillis == null) ? 0 : durationInMillis.hashCode());
167         result = prime * result + ((endTime == null) ? 0 : endTime.hashCode());
168         result = prime * result + ((processInstanceId == null) ? 0 : processInstanceId.hashCode());
169         result = prime * result + ((startTime == null) ? 0 : startTime.hashCode());
170         return result;
171     }
172
173     @JsonIgnore
174     @Override
175     public boolean equals(final Object obj) {
176         if (obj instanceof ActivityInstance) {
177             final ActivityInstance other = (ActivityInstance) obj;
178             return isEqual(activityId, other.activityId) && isEqual(activityName, other.activityName)
179                     && isEqual(activityType, other.activityType) && isEqual(processInstanceId, other.processInstanceId)
180                     && isEqual(calledProcessInstanceId, other.calledProcessInstanceId)
181                     && isEqual(startTime, other.startTime) && isEqual(endTime, other.endTime)
182                     && isEqual(durationInMillis, other.durationInMillis);
183         }
184         return false;
185     }
186
187 }