5a84009c07d3445398e0ede319f72ddf48ec46b1
[policy/drools-applications.git] / controlloop / common / 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  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.sdnr;
22
23 import com.google.gson.annotations.SerializedName;
24
25 import java.io.Serializable;
26
27 public class PciRequestWrapper extends PciWrapper implements Serializable {
28
29     private static final long serialVersionUID = 879766924715980798L;
30
31     @SerializedName(value = "body")
32     private PciRequest body;
33
34     public PciRequestWrapper() {
35         super();
36     }
37
38     public PciRequestWrapper(PciRequest request) {
39         body = request;
40     }
41
42     /**
43      * Get the body.
44      * 
45      * @return the body
46      */
47     public PciRequest getBody() {
48         return body;
49     }
50
51     /**
52      * Set the body.
53      * 
54      * @param body
55      *            the body to set
56      */
57     public void setBody(PciRequest 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         PciRequestWrapper other = (PciRequestWrapper) 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 }