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;
32 public class PciWrapper implements Serializable {
34 private static final long serialVersionUID = 375215806432396532L;
36 private String version;
38 @SerializedName(value = "cambria-partition")
39 private String cambriaPartition;
41 @SerializedName(value = "rpc-name")
42 private String rpcName;
44 @SerializedName(value = "correlation-id")
45 private String correlationId;
50 // Create a default PciWrapper instance
54 public String toString() {
55 return "Wrapper [version=" + version + ", cambriaPartition=" + cambriaPartition + ", rpcName=" + rpcName
56 + ", correlationId=" + correlationId + ", type=" + type + "]";
60 public int hashCode() {
63 result = prime * result + ((cambriaPartition == null) ? 0 : cambriaPartition.hashCode());
64 result = prime * result + ((correlationId == null) ? 0 : correlationId.hashCode());
65 result = prime * result + ((rpcName == null) ? 0 : rpcName.hashCode());
66 result = prime * result + ((type == null) ? 0 : type.hashCode());
67 result = prime * result + ((version == null) ? 0 : version.hashCode());
72 public boolean equals(Object obj) {
79 if (getClass() != obj.getClass()) {
82 PciWrapper other = (PciWrapper) obj;
83 if (cambriaPartition == null) {
84 if (other.cambriaPartition != null) {
87 } else if (!cambriaPartition.equals(other.cambriaPartition)) {
90 if (correlationId == null) {
91 if (other.correlationId != null) {
94 } else if (!correlationId.equals(other.correlationId)) {
97 if (rpcName == null) {
98 if (other.rpcName != null) {
101 } else if (!rpcName.equals(other.rpcName)) {
105 if (other.type != null) {
108 } else if (!type.equals(other.type)) {
111 if (version == null) {
112 return other.version == null;
114 return version.equals(other.version);