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 PciRequest implements Serializable {
30 private static final long serialVersionUID = 323235565922846624L;
32 @SerializedName(value = "CommonHeader")
33 private PciCommonHeader commonHeader;
35 @SerializedName(value = "Action")
36 private String action;
38 @SerializedName(value = "Payload")
39 private String payload;
42 // Create a default PCI request
45 public PciCommonHeader getCommonHeader() {
49 public void setCommonHeader(PciCommonHeader commonHeader) {
50 this.commonHeader = commonHeader;
58 public String getAction() {
68 public void setAction(String action) {
78 public String getPayload() {
89 public void setPayload(String payload) {
90 this.payload = payload;
94 public String toString() {
95 return "PciRequest[commonHeader=" + commonHeader + ", action=" + action + ", payload=" + payload + "]";
99 public int hashCode() {
100 final int prime = 31;
102 result = prime * result + ((commonHeader == null) ? 0 : commonHeader.hashCode());
103 result = prime * result + ((action == null) ? 0 : action.hashCode());
104 result = prime * result + ((payload == null) ? 0 : payload.hashCode());
109 public boolean equals(Object obj) {
116 if (getClass() != obj.getClass()) {
119 PciRequest other = (PciRequest) obj;
120 if (commonHeader == null) {
121 if (other.commonHeader != null) {
124 } else if (!commonHeader.equals(other.commonHeader)) {
127 if (action == null) {
128 if (other.action != null) {
131 } else if (!action.equals(other.action)) {
134 if (payload == null) {
135 if (other.payload != null) {
138 } else if (!payload.equals(other.payload)) {