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