Use lombok annotations for objects in models-interaction/models-impl module
[policy/models.git] / models-interactions / model-impl / sdnr / src / main / java / org / onap / policy / sdnr / PciWrapper.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * sdnr
4  * ================================================================================
5  * Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
6  * Modifications Copyright (C) 2019 Nordix Foundation.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.sdnr;
23
24 import com.google.gson.annotations.SerializedName;
25
26 import java.io.Serializable;
27 import lombok.Getter;
28 import lombok.Setter;
29
30 @Getter
31 @Setter
32 public class PciWrapper implements Serializable {
33
34     private static final long serialVersionUID = 375215806432396532L;
35
36     private String version;
37
38     @SerializedName(value = "cambria-partition")
39     private String cambriaPartition;
40
41     @SerializedName(value = "rpc-name")
42     private String rpcName;
43
44     @SerializedName(value = "correlation-id")
45     private String correlationId;
46
47     private String type;
48
49     public PciWrapper() {
50         // Create a default PciWrapper instance
51     }
52
53     @Override
54     public String toString() {
55         return "Wrapper [version=" + version + ", cambriaPartition=" + cambriaPartition + ", rpcName=" + rpcName
56             + ", correlationId=" + correlationId + ", type=" + type + "]";
57     }
58
59     @Override
60     public int hashCode() {
61         final int prime = 31;
62         int result = 1;
63         result = prime * result + ((cambriaPartition == null) ? 0 : cambriaPartition.hashCode());
64         result = prime * result + ((correlationId == null) ? 0 : correlationId.hashCode());
65         result = prime * result + ((rpcName == null) ? 0 : rpcName.hashCode());
66         result = prime * result + ((type == null) ? 0 : type.hashCode());
67         result = prime * result + ((version == null) ? 0 : version.hashCode());
68         return result;
69     }
70
71     @Override
72     public boolean equals(Object obj) {
73         if (this == obj) {
74             return true;
75         }
76         if (obj == null) {
77             return false;
78         }
79         if (getClass() != obj.getClass()) {
80             return false;
81         }
82         PciWrapper other = (PciWrapper) obj;
83         if (cambriaPartition == null) {
84             if (other.cambriaPartition != null) {
85                 return false;
86             }
87         } else if (!cambriaPartition.equals(other.cambriaPartition)) {
88             return false;
89         }
90         if (correlationId == null) {
91             if (other.correlationId != null) {
92                 return false;
93             }
94         } else if (!correlationId.equals(other.correlationId)) {
95             return false;
96         }
97         if (rpcName == null) {
98             if (other.rpcName != null) {
99                 return false;
100             }
101         } else if (!rpcName.equals(other.rpcName)) {
102             return false;
103         }
104         if (type == null) {
105             if (other.type != null) {
106                 return false;
107             }
108         } else if (!type.equals(other.type)) {
109             return false;
110         }
111         if (version == null) {
112             return other.version == null;
113         } else {
114             return version.equals(other.version);
115         }
116     }
117 }