2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2019 AT&T 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.so;
24 import com.google.gson.annotations.SerializedName;
26 import java.io.Serializable;
28 public class SoResponseWrapper implements Serializable {
30 private static final long serialVersionUID = 7673023687132889069L;
32 @SerializedName("SoResponse")
33 private SoResponse soResponse;
35 private transient String requestId;
37 public SoResponseWrapper(SoResponse response, String reqId) {
38 this.soResponse = response;
39 this.requestId = reqId;
43 public boolean equals(Object obj) {
50 if (getClass() != obj.getClass()) {
53 SoResponseWrapper other = (SoResponseWrapper) obj;
54 if (soResponse == null) {
55 if (other.soResponse != null) {
59 else if (!soResponse.equals(other.soResponse)) {
62 if (requestId == null) {
63 if (other.requestId != null) {
67 else if (!requestId.equals(other.requestId)) {
73 public String getRequestId() {
77 public SoResponse getSoResponse() {
82 public int hashCode() {
84 int result = super.hashCode();
85 result = prime * result + ((soResponse == null) ? 0 : soResponse.hashCode());
86 result = prime * result + ((requestId == null) ? 0 : requestId.hashCode());
90 public void setRequestId(String requestId) {
91 this.requestId = requestId;
94 public void setSoResponse(SoResponse response) {
95 soResponse = response;
99 public String toString() {
100 return "SOResponseWrapper [SOResponse=" + soResponse + ", RequestId=" + requestId + "]";