2 * ============LICENSE_START=======================================================
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
22 package org.onap.policy.sdnr;
24 import com.google.gson.annotations.SerializedName;
26 import java.io.Serializable;
28 public class PciWrapper implements Serializable {
30 private static final long serialVersionUID = 375215806432396532L;
32 @SerializedName(value = "version")
33 private String version;
35 @SerializedName(value = "cambria-partition")
36 private String cambriaPartition;
38 @SerializedName(value = "rpc-name")
39 private String rpcName;
41 @SerializedName(value = "correlation-id")
42 private String correlationId;
44 @SerializedName(value = "type")
48 // Create a default PciWrapper instance
56 public String getVersion() {
63 * @param version the version to set
65 public void setVersion(String version) {
66 this.version = version;
70 * Get the cambria partition.
72 * @return the cambriaPartition
74 public String getCambriaPartition() {
75 return cambriaPartition;
79 * Set the cambria partition.
81 * @param cambriaPartition the cambriaPartition to set
83 public void setCambriaPartition(String cambriaPartition) {
84 this.cambriaPartition = cambriaPartition;
92 public String getRpcName() {
99 * @param rpcName the rpcName to set
101 public void setRpcName(String rpcName) {
102 this.rpcName = rpcName;
106 * Get the correlation Id.
108 * @return the correlationId
110 public String getCorrelationId() {
111 return correlationId;
115 * Set the correclation Id.
117 * @param correlationId the correlationId to set
119 public void setCorrelationId(String correlationId) {
120 this.correlationId = correlationId;
128 public String getType() {
135 * @param type the type to set
137 public void setType(String type) {
142 public String toString() {
143 return "Wrapper [version=" + version + ", cambriaPartition=" + cambriaPartition + ", rpcName=" + rpcName
144 + ", correlationId=" + correlationId + ", type=" + type + "]";
148 public int hashCode() {
149 final int prime = 31;
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());
160 public boolean equals(Object obj) {
167 if (getClass() != obj.getClass()) {
170 PciWrapper other = (PciWrapper) obj;
171 if (cambriaPartition == null) {
172 if (other.cambriaPartition != null) {
175 } else if (!cambriaPartition.equals(other.cambriaPartition)) {
178 if (correlationId == null) {
179 if (other.correlationId != null) {
182 } else if (!correlationId.equals(other.correlationId)) {
185 if (rpcName == null) {
186 if (other.rpcName != null) {
189 } else if (!rpcName.equals(other.rpcName)) {
193 if (other.type != null) {
196 } else if (!type.equals(other.type)) {
199 if (version == null) {
200 if (other.version != null) {
203 } else if (!version.equals(other.version)) {