Merge "Add debugging of REST call"
[policy/drools-applications.git] / controlloop / common / model-impl / sdnr / src / main / java / org / onap / policy / sdnr / PciRequest.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 PciRequest implements Serializable {
28
29     private static final long serialVersionUID = 323235565922846624L;
30
31     @SerializedName(value = "CommonHeader")
32     private PciCommonHeader commonHeader;
33
34     @SerializedName(value = "Action")
35     private String action;
36
37     @SerializedName(value = "Payload")
38     private String payload;
39
40     public PciRequest() {
41         // Create a default PCI request
42     }
43
44     public PciCommonHeader getCommonHeader() {
45         return commonHeader;
46     }
47
48     public void setCommonHeader(PciCommonHeader commonHeader) {
49         this.commonHeader = commonHeader;
50     }
51
52     /**
53      * Get the action.
54      * 
55      * @return the action
56      */
57     public String getAction() {
58         return action;
59     }
60
61     /**
62      * Set the action.
63      * 
64      * @param action
65      *            the action to set
66      */
67     public void setAction(String action) {
68         this.action = action;
69     }
70
71     /**
72      * Get the payload.
73      * 
74      * @return the payload
75      */
76
77     public String getPayload() {
78         return payload;
79     }
80
81     /**
82      * Set the payload.
83      * 
84      * @param action
85      *            the action to set
86      */
87
88     public void setPayload(String payload) {
89         this.payload = payload;
90     }
91
92     @Override
93     public String toString() {
94         return "PciRequest[commonHeader=" + commonHeader + ", action=" + action + ", payload=" + payload + "]";
95     }
96
97     @Override
98     public int hashCode() {
99         final int prime = 31;
100         int result = 1;
101         result = prime * result + ((commonHeader == null) ? 0 : commonHeader.hashCode());
102         result = prime * result + ((action == null) ? 0 : action.hashCode());
103         result = prime * result + ((payload == null) ? 0 : payload.hashCode());
104         return result;
105     }
106
107     @Override
108     public boolean equals(Object obj) {
109         if (this == obj) {
110             return true;
111         }
112         if (obj == null) {
113             return false;
114         }
115         if (getClass() != obj.getClass()) {
116             return false;
117         }
118         PciRequest other = (PciRequest) obj;
119         if (commonHeader == null) {
120             if (other.commonHeader != null) {
121                 return false;
122             }
123         } else if (!commonHeader.equals(other.commonHeader)) {
124             return false;
125         }
126         if (action == null) {
127             if (other.action != null) {
128                 return false;
129             }
130         } else if (!action.equals(other.action)) {
131             return false;
132         }
133         if (payload == null) {
134             if (other.payload != null) {
135                 return false;
136             }
137         } else if (!payload.equals(other.payload)) {
138             return false;
139         }
140         return true;
141     }
142
143 }