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