Adding rest service for so monitoring
[so.git] / so-monitoring / so-monitoring-handler / src / main / java / org / onap / so / montoring / model / ProcessDefinitionDetail.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.model;
21
22 import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
23
24 /**
25  * @author waqas.ikram@ericsson.com
26  *
27  */
28 public class ProcessDefinitionDetail {
29
30     private final String processDefinitionId;
31     private final String processDefinitionXml;
32
33     public ProcessDefinitionDetail(final String processDefinitionId, final String processDefinitionXml) {
34         this.processDefinitionId = processDefinitionId;
35         this.processDefinitionXml = processDefinitionXml;
36     }
37
38     /**
39      * @return the processDefinitionId
40      */
41     public String getProcessDefinitionId() {
42         return processDefinitionId;
43     }
44
45     /**
46      * @return the processDefinitionXml
47      */
48     public String getProcessDefinitionXml() {
49         return processDefinitionXml;
50     }
51
52     @Override
53     public int hashCode() {
54         final int prime = 31;
55         int result = 1;
56         result = prime * result + ((processDefinitionId == null) ? 0 : processDefinitionId.hashCode());
57         result = prime * result + ((processDefinitionXml == null) ? 0 : processDefinitionXml.hashCode());
58         return result;
59     }
60
61     @Override
62     public boolean equals(final Object obj) {
63         if (obj instanceof ProcessDefinitionDetail) {
64             final ProcessDefinitionDetail other = (ProcessDefinitionDetail) obj;
65             return isEqual(processDefinitionId, other.processDefinitionId)
66                     && isEqual(processDefinitionXml, other.processDefinitionXml);
67         }
68         return false;
69     }
70
71     @Override
72     public String toString() {
73         return "ProcessDefinitionDetail [processDefinitionId=" + processDefinitionId + ", processDefinitionXml="
74                 + processDefinitionXml + "]";
75     }
76 }