456c578774dded2c62125dd062d24e2136453ba6
[policy/drools-applications.git] / controlloop / common / 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  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.sdnr;
22
23 import com.google.gson.annotations.SerializedName;
24
25 import java.io.Serializable;
26
27 public class PciWrapper implements Serializable {
28
29     private static final long serialVersionUID = 375215806432396532L;
30
31     @SerializedName(value = "version")
32     private String version;
33
34     @SerializedName(value = "cambria-partition")
35     private String cambriaPartition;
36
37     @SerializedName(value = "rpc-name")
38     private String rpcName;
39
40     @SerializedName(value = "correlation-id")
41     private String correlationId;
42
43     @SerializedName(value = "type")
44     private String type;
45
46     public PciWrapper() {
47         // Create a default PciWrapper instance
48     }
49
50     /**
51      * Get the version.
52      * 
53      * @return the version
54      */
55     public String getVersion() {
56         return version;
57     }
58
59     /**
60      * Set the version.
61      * 
62      * @param version
63      *            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
82      *            the cambriaPartition to set
83      */
84     public void setCambriaPartition(String cambriaPartition) {
85         this.cambriaPartition = cambriaPartition;
86     }
87
88     /**
89      * Get the RPN name.
90      * 
91      * @return the rpcName
92      */
93     public String getRpcName() {
94         return rpcName;
95     }
96
97     /**
98      * Set the RPC name.
99      * 
100      * @param rpcName
101      *            the rpcName to set
102      */
103     public void setRpcName(String rpcName) {
104         this.rpcName = rpcName;
105     }
106
107     /**
108      * Get the correlation Id.
109      * 
110      * @return the correlationId
111      */
112     public String getCorrelationId() {
113         return correlationId;
114     }
115
116     /**
117      * Set the correclation Id.
118      * 
119      * @param correlationId
120      *            the correlationId to set
121      */
122     public void setCorrelationId(String correlationId) {
123         this.correlationId = correlationId;
124     }
125
126     /**
127      * Get the type.
128      * 
129      * @return the type
130      */
131     public String getType() {
132         return type;
133     }
134
135     /**
136      * Set the type.
137      * 
138      * @param type
139      *            the type to set
140      */
141     public void setType(String type) {
142         this.type = type;
143     }
144
145     @Override
146     public String toString() {
147         return "Wrapper [version=" + version + ", cambriaPartition=" + cambriaPartition + ", rpcName=" + rpcName
148                 + ", correlationId=" + correlationId + ", type=" + type + "]";
149     }
150
151     @Override
152     public int hashCode() {
153         final int prime = 31;
154         int result = 1;
155         result = prime * result + ((cambriaPartition == null) ? 0 : cambriaPartition.hashCode());
156         result = prime * result + ((correlationId == null) ? 0 : correlationId.hashCode());
157         result = prime * result + ((rpcName == null) ? 0 : rpcName.hashCode());
158         result = prime * result + ((type == null) ? 0 : type.hashCode());
159         result = prime * result + ((version == null) ? 0 : version.hashCode());
160         return result;
161     }
162
163     @Override
164     public boolean equals(Object obj) {
165         if (this == obj) {
166             return true;
167         }
168         if (obj == null) {
169             return false;
170         }
171         if (getClass() != obj.getClass()) {
172             return false;
173         }
174         PciWrapper other = (PciWrapper) obj;
175         if (cambriaPartition == null) {
176             if (other.cambriaPartition != null) {
177                 return false;
178             }
179         } else if (!cambriaPartition.equals(other.cambriaPartition)) {
180             return false;
181         }
182         if (correlationId == null) {
183             if (other.correlationId != null) {
184                 return false;
185             }
186         } else if (!correlationId.equals(other.correlationId)) {
187             return false;
188         }
189         if (rpcName == null) {
190             if (other.rpcName != null) {
191                 return false;
192             }
193         } else if (!rpcName.equals(other.rpcName)) {
194             return false;
195         }
196         if (type == null) {
197             if (other.type != null) {
198                 return false;
199             }
200         } else if (!type.equals(other.type)) {
201             return false;
202         }
203         if (version == null) {
204             if (other.version != null) {
205                 return false;
206             }
207         } else if (!version.equals(other.version)) {
208             return false;
209         }
210         return true;
211     }
212
213 }