7b9bcda25bdfed466d63cce72ccd846ca761881c
[policy/models.git] / models-interactions / model-impl / appclcm / src / main / java / org / onap / policy / appclcm / LcmRequestWrapper.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 LcmRequestWrapper extends LcmWrapper implements Serializable {
29
30     private static final long serialVersionUID = 424866914715980798L;
31
32     @SerializedName(value = "body")
33     private LcmRequest body;
34
35     public LcmRequestWrapper() {
36         super();
37     }
38
39     public LcmRequestWrapper(LcmRequest request) {
40         body = request;
41     }
42
43     /**
44      * Get the body.
45      * 
46      * @return the body
47      */
48     public LcmRequest getBody() {
49         return body;
50     }
51
52     /**
53      * Set the body.
54      * 
55      * @param body the body to set
56      */
57     public void setBody(LcmRequest body) {
58         this.body = body;
59     }
60
61     @Override
62     public String toString() {
63         return "RequestWrapper [body=" + body + ", toString()=" + super.toString() + "]";
64     }
65
66     @Override
67     public int hashCode() {
68         final int prime = 31;
69         int result = super.hashCode();
70         result = prime * result + ((body == null) ? 0 : body.hashCode());
71         return result;
72     }
73
74     @Override
75     public boolean equals(Object obj) {
76         if (this == obj) {
77             return true;
78         }
79         if (!super.equals(obj)) {
80             return false;
81         }
82         if (getClass() != obj.getClass()) {
83             return false;
84         }
85         LcmRequestWrapper other = (LcmRequestWrapper) obj;
86         if (body == null) {
87             if (other.body != null) {
88                 return false;
89             }
90         } else if (!body.equals(other.body)) {
91             return false;
92         }
93         return true;
94     }
95
96 }