322abb015d70616f2bdee6adeecd9e55cd43fd3b
[policy/drools-applications.git] / controlloop / common / model-impl / appclcm / src / main / java / org / onap / policy / appclcm / LcmWrapper.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * appclcm
4  * ================================================================================
5  * Copyright (C) 2017-2018 AT&T 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.appclcm;
22
23 import com.google.gson.annotations.SerializedName;
24
25 import java.io.Serializable;
26
27 public class LcmWrapper implements Serializable {
28
29     private static final long serialVersionUID = 753005805432396532L;
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 LcmWrapper() {
47         // Create a default LCMWrapper 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 the version to set
63      */
64     public void setVersion(String version) {
65         this.version = version;
66     }
67
68     /**
69      * Get the cambria partition.
70      * 
71      * @return the cambriaPartition
72      */
73     public String getCambriaPartition() {
74         return cambriaPartition;
75     }
76
77     /**
78      * Set the cambria partition.
79      * 
80      * @param cambriaPartition the cambriaPartition to set
81      */
82     public void setCambriaPartition(String cambriaPartition) {
83         this.cambriaPartition = cambriaPartition;
84     }
85
86     /**
87      * Get the RPN name.
88      * 
89      * @return the rpcName
90      */
91     public String getRpcName() {
92         return rpcName;
93     }
94
95     /**
96      * Set the RPC name.
97      * 
98      * @param rpcName the rpcName to set
99      */
100     public void setRpcName(String rpcName) {
101         this.rpcName = rpcName;
102     }
103
104     /**
105      * Get the correlation Id.
106      * 
107      * @return the correlationId
108      */
109     public String getCorrelationId() {
110         return correlationId;
111     }
112
113     /**
114      * Set the correclation Id.
115      * 
116      * @param correlationId the correlationId to set
117      */
118     public void setCorrelationId(String correlationId) {
119         this.correlationId = correlationId;
120     }
121
122     /**
123      * Get the type.
124      * 
125      * @return the type
126      */
127     public String getType() {
128         return type;
129     }
130
131     /**
132      * Set the type.
133      * 
134      * @param type the type to set
135      */
136     public void setType(String type) {
137         this.type = type;
138     }
139
140     @Override
141     public String toString() {
142         return "Wrapper [version=" + version + ", cambriaPartition=" + cambriaPartition + ", rpcName=" + rpcName
143                 + ", correlationId=" + correlationId + ", type=" + type + "]";
144     }
145
146     @Override
147     public int hashCode() {
148         final int prime = 31;
149         int result = 1;
150         result = prime * result + ((cambriaPartition == null) ? 0 : cambriaPartition.hashCode());
151         result = prime * result + ((correlationId == null) ? 0 : correlationId.hashCode());
152         result = prime * result + ((rpcName == null) ? 0 : rpcName.hashCode());
153         result = prime * result + ((type == null) ? 0 : type.hashCode());
154         result = prime * result + ((version == null) ? 0 : version.hashCode());
155         return result;
156     }
157
158     @Override
159     public boolean equals(Object obj) {
160         if (this == obj) {
161             return true;
162         }
163         if (obj == null) {
164             return false;
165         }
166         if (getClass() != obj.getClass()) {
167             return false;
168         }
169         LcmWrapper other = (LcmWrapper) obj;
170         if (cambriaPartition == null) {
171             if (other.cambriaPartition != null) {
172                 return false;
173             }
174         } else if (!cambriaPartition.equals(other.cambriaPartition)) {
175             return false;
176         }
177         if (correlationId == null) {
178             if (other.correlationId != null) {
179                 return false;
180             }
181         } else if (!correlationId.equals(other.correlationId)) {
182             return false;
183         }
184         if (rpcName == null) {
185             if (other.rpcName != null) {
186                 return false;
187             }
188         } else if (!rpcName.equals(other.rpcName)) {
189             return false;
190         }
191         if (type == null) {
192             if (other.type != null) {
193                 return false;
194             }
195         } else if (!type.equals(other.type)) {
196             return false;
197         }
198         if (version == null) {
199             if (other.version != null) {
200                 return false;
201             }
202         } else if (!version.equals(other.version)) {
203             return false;
204         }
205         return true;
206     }
207
208 }