cc1672a6a94ca15407a4b448524f99c44cfe935b
[policy/models.git] / models-interactions / model-impl / appclcm / src / main / java / org / onap / policy / appclcm / LcmResponseWrapper.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * appclcm
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
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
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=========================================================
20  */
21
22 package org.onap.policy.appclcm;
23
24 import com.google.gson.annotations.SerializedName;
25
26 import java.io.Serializable;
27
28 public class LcmResponseWrapper extends LcmWrapper implements Serializable {
29
30     private static final long serialVersionUID = 463937813781086802L;
31
32     @SerializedName(value = "body")
33     private LcmResponse body;
34
35     public LcmResponseWrapper() {
36         super();
37     }
38
39     /**
40      * Get the body.
41      * 
42      * @return the body
43      */
44     public LcmResponse getBody() {
45         return body;
46     }
47
48     /**
49      * Set the body.
50      * 
51      * @param body the body to set
52      */
53     public void setBody(LcmResponse body) {
54         this.body = body;
55     }
56
57     @Override
58     public String toString() {
59         return "ResponseWrapper [body=" + body + ", toString()=" + super.toString() + "]";
60     }
61
62     @Override
63     public int hashCode() {
64         final int prime = 31;
65         int result = super.hashCode();
66         result = prime * result + ((body == null) ? 0 : body.hashCode());
67         return result;
68     }
69
70     @Override
71     public boolean equals(Object obj) {
72         if (this == obj) {
73             return true;
74         }
75         if (!super.equals(obj)) {
76             return false;
77         }
78         if (getClass() != obj.getClass()) {
79             return false;
80         }
81         LcmResponseWrapper other = (LcmResponseWrapper) obj;
82         if (body == null) {
83             if (other.body != null) {
84                 return false;
85             }
86         } else if (!body.equals(other.body)) {
87             return false;
88         }
89         return true;
90     }
91 }