revert the changes
[so.git] / so-monitoring / so-monitoring-handler / src / main / java / org / onap / so / montoring / camunda / model / ProcessInstance.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.montoring.camunda.model;
21
22 import static org.onap.so.montoring.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 @JsonIgnoreProperties(ignoreUnknown = true)
31 public class ProcessInstance {
32
33     private String id;
34     private String processDefinitionId;
35     private String processDefinitionName;
36     private String superProcessInstanceId;
37
38     public ProcessInstance() {}
39
40     /**
41      * @return the id
42      */
43     public String getId() {
44         return id;
45     }
46
47     /**
48      * @param id the id to set
49      */
50     public void setId(final String id) {
51         this.id = id;
52     }
53
54
55     /**
56      * @return the processDefinitionId
57      */
58     public String getProcessDefinitionId() {
59         return processDefinitionId;
60     }
61
62     /**
63      * @param processDefinitionId the processDefinitionId to set
64      */
65     public void setProcessDefinitionId(final String processDefinitionId) {
66         this.processDefinitionId = processDefinitionId;
67     }
68
69     /**
70      * @return the processDefinitionName
71      */
72     public String getProcessDefinitionName() {
73         return processDefinitionName;
74     }
75
76     /**
77      * @param processDefinitionName the processDefinitionName to set
78      */
79     public void setProcessDefinitionName(final String processDefinitionName) {
80         this.processDefinitionName = processDefinitionName;
81     }
82
83     /**
84      * @return the superProcessInstanceId
85      */
86     public String getSuperProcessInstanceId() {
87         return superProcessInstanceId;
88     }
89
90     /**
91      * @param superProcessInstanceId the superProcessInstanceId to set
92      */
93     public void setSuperProcessInstanceId(final String superProcessInstanceId) {
94         this.superProcessInstanceId = superProcessInstanceId;
95     }
96
97
98     @JsonIgnore
99     @Override
100     public int hashCode() {
101         final int prime = 31;
102         int result = 1;
103         result = prime * result + ((id == null) ? 0 : id.hashCode());
104         result = prime * result + ((processDefinitionId == null) ? 0 : processDefinitionId.hashCode());
105         result = prime * result + ((processDefinitionName == null) ? 0 : processDefinitionName.hashCode());
106         result = prime * result + ((superProcessInstanceId == null) ? 0 : superProcessInstanceId.hashCode());
107         return result;
108     }
109
110     @JsonIgnore
111     @Override
112     public boolean equals(final Object obj) {
113         if (obj instanceof ProcessInstance) {
114             final ProcessInstance other = (ProcessInstance) obj;
115             return isEqual(id, other.id) && isEqual(processDefinitionId, other.processDefinitionId)
116                     && isEqual(processDefinitionName, other.processDefinitionName)
117                     && isEqual(superProcessInstanceId, other.superProcessInstanceId);
118         }
119
120         return false;
121     }
122
123     @JsonIgnore
124     @Override
125     public String toString() {
126         return "ProcessInstance [id=" + id + ", processDefinitionId=" + processDefinitionId + ", processDefinitionName="
127                 + processDefinitionName + "]";
128     }
129 }