fix code smell in model-impl
[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
28 public class PciWrapper implements Serializable {
29
30     private static final long serialVersionUID = 375215806432396532L;
31
32     @SerializedName(value = "version")
33     private String version;
34
35     @SerializedName(value = "cambria-partition")
36     private String cambriaPartition;
37
38     @SerializedName(value = "rpc-name")
39     private String rpcName;
40
41     @SerializedName(value = "correlation-id")
42     private String correlationId;
43
44     @SerializedName(value = "type")
45     private String type;
46
47     public PciWrapper() {
48         // Create a default PciWrapper instance
49     }
50
51     /**
52      * Get the version.
53      *
54      * @return the version
55      */
56     public String getVersion() {
57         return version;
58     }
59
60     /**
61      * Set the version.
62      *
63      * @param version the version to set
64      */
65     public void setVersion(String version) {
66         this.version = version;
67     }
68
69     /**
70      * Get the cambria partition.
71      *
72      * @return the cambriaPartition
73      */
74     public String getCambriaPartition() {
75         return cambriaPartition;
76     }
77
78     /**
79      * Set the cambria partition.
80      *
81      * @param cambriaPartition the cambriaPartition to set
82      */
83     public void setCambriaPartition(String cambriaPartition) {
84         this.cambriaPartition = cambriaPartition;
85     }
86
87     /**
88      * Get the RPN name.
89      *
90      * @return the rpcName
91      */
92     public String getRpcName() {
93         return rpcName;
94     }
95
96     /**
97      * Set the RPC name.
98      *
99      * @param rpcName the rpcName to set
100      */
101     public void setRpcName(String rpcName) {
102         this.rpcName = rpcName;
103     }
104
105     /**
106      * Get the correlation Id.
107      *
108      * @return the correlationId
109      */
110     public String getCorrelationId() {
111         return correlationId;
112     }
113
114     /**
115      * Set the correclation Id.
116      *
117      * @param correlationId the correlationId to set
118      */
119     public void setCorrelationId(String correlationId) {
120         this.correlationId = correlationId;
121     }
122
123     /**
124      * Get the type.
125      *
126      * @return the type
127      */
128     public String getType() {
129         return type;
130     }
131
132     /**
133      * Set the type.
134      *
135      * @param type the type to set
136      */
137     public void setType(String type) {
138         this.type = type;
139     }
140
141     @Override
142     public String toString() {
143         return "Wrapper [version=" + version + ", cambriaPartition=" + cambriaPartition + ", rpcName=" + rpcName
144             + ", correlationId=" + correlationId + ", type=" + type + "]";
145     }
146
147     @Override
148     public int hashCode() {
149         final int prime = 31;
150         int result = 1;
151         result = prime * result + ((cambriaPartition == null) ? 0 : cambriaPartition.hashCode());
152         result = prime * result + ((correlationId == null) ? 0 : correlationId.hashCode());
153         result = prime * result + ((rpcName == null) ? 0 : rpcName.hashCode());
154         result = prime * result + ((type == null) ? 0 : type.hashCode());
155         result = prime * result + ((version == null) ? 0 : version.hashCode());
156         return result;
157     }
158
159     @Override
160     public boolean equals(Object obj) {
161         if (this == obj) {
162             return true;
163         }
164         if (obj == null) {
165             return false;
166         }
167         if (getClass() != obj.getClass()) {
168             return false;
169         }
170         PciWrapper other = (PciWrapper) obj;
171         if (cambriaPartition == null) {
172             if (other.cambriaPartition != null) {
173                 return false;
174             }
175         } else if (!cambriaPartition.equals(other.cambriaPartition)) {
176             return false;
177         }
178         if (correlationId == null) {
179             if (other.correlationId != null) {
180                 return false;
181             }
182         } else if (!correlationId.equals(other.correlationId)) {
183             return false;
184         }
185         if (rpcName == null) {
186             if (other.rpcName != null) {
187                 return false;
188             }
189         } else if (!rpcName.equals(other.rpcName)) {
190             return false;
191         }
192         if (type == null) {
193             if (other.type != null) {
194                 return false;
195             }
196         } else if (!type.equals(other.type)) {
197             return false;
198         }
199         if (version == null) {
200             if (other.version != null) {
201                 return false;
202             }
203         } else if (!version.equals(other.version)) {
204             return false;
205         }
206         return true;
207     }
208
209 }