migrate model-impl from drools-applications
[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
64      *            the version to set
65      */
66     public void setVersion(String version) {
67         this.version = version;
68     }
69
70     /**
71      * Get the cambria partition.
72      * 
73      * @return the cambriaPartition
74      */
75     public String getCambriaPartition() {
76         return cambriaPartition;
77     }
78
79     /**
80      * Set the cambria partition.
81      * 
82      * @param cambriaPartition
83      *            the cambriaPartition to set
84      */
85     public void setCambriaPartition(String cambriaPartition) {
86         this.cambriaPartition = cambriaPartition;
87     }
88
89     /**
90      * Get the RPN name.
91      * 
92      * @return the rpcName
93      */
94     public String getRpcName() {
95         return rpcName;
96     }
97
98     /**
99      * Set the RPC name.
100      * 
101      * @param rpcName
102      *            the rpcName to set
103      */
104     public void setRpcName(String rpcName) {
105         this.rpcName = rpcName;
106     }
107
108     /**
109      * Get the correlation Id.
110      * 
111      * @return the correlationId
112      */
113     public String getCorrelationId() {
114         return correlationId;
115     }
116
117     /**
118      * Set the correclation Id.
119      * 
120      * @param correlationId
121      *            the correlationId to set
122      */
123     public void setCorrelationId(String correlationId) {
124         this.correlationId = correlationId;
125     }
126
127     /**
128      * Get the type.
129      * 
130      * @return the type
131      */
132     public String getType() {
133         return type;
134     }
135
136     /**
137      * Set the type.
138      * 
139      * @param type
140      *            the type to set
141      */
142     public void setType(String type) {
143         this.type = type;
144     }
145
146     @Override
147     public String toString() {
148         return "Wrapper [version=" + version + ", cambriaPartition=" + cambriaPartition + ", rpcName=" + rpcName
149                 + ", correlationId=" + correlationId + ", type=" + type + "]";
150     }
151
152     @Override
153     public int hashCode() {
154         final int prime = 31;
155         int result = 1;
156         result = prime * result + ((cambriaPartition == null) ? 0 : cambriaPartition.hashCode());
157         result = prime * result + ((correlationId == null) ? 0 : correlationId.hashCode());
158         result = prime * result + ((rpcName == null) ? 0 : rpcName.hashCode());
159         result = prime * result + ((type == null) ? 0 : type.hashCode());
160         result = prime * result + ((version == null) ? 0 : version.hashCode());
161         return result;
162     }
163
164     @Override
165     public boolean equals(Object obj) {
166         if (this == obj) {
167             return true;
168         }
169         if (obj == null) {
170             return false;
171         }
172         if (getClass() != obj.getClass()) {
173             return false;
174         }
175         PciWrapper other = (PciWrapper) obj;
176         if (cambriaPartition == null) {
177             if (other.cambriaPartition != null) {
178                 return false;
179             }
180         } else if (!cambriaPartition.equals(other.cambriaPartition)) {
181             return false;
182         }
183         if (correlationId == null) {
184             if (other.correlationId != null) {
185                 return false;
186             }
187         } else if (!correlationId.equals(other.correlationId)) {
188             return false;
189         }
190         if (rpcName == null) {
191             if (other.rpcName != null) {
192                 return false;
193             }
194         } else if (!rpcName.equals(other.rpcName)) {
195             return false;
196         }
197         if (type == null) {
198             if (other.type != null) {
199                 return false;
200             }
201         } else if (!type.equals(other.type)) {
202             return false;
203         }
204         if (version == null) {
205             if (other.version != null) {
206                 return false;
207             }
208         } else if (!version.equals(other.version)) {
209             return false;
210         }
211         return true;
212     }
213
214 }