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