2 * ============LICENSE_START=======================================================
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
22 package org.onap.policy.appclcm;
24 import com.google.gson.annotations.SerializedName;
26 import java.io.Serializable;
29 public class LcmRequest implements Serializable {
31 private static final long serialVersionUID = 219375564922846624L;
33 @SerializedName(value = "common-header")
34 private LcmCommonHeader commonHeader;
36 @SerializedName(value = "action")
37 private String action;
39 @SerializedName(value = "action-identifiers")
40 private Map<String, String> actionIdentifiers;
42 @SerializedName(value = "payload")
43 private String payload;
46 // Create a default LCM request
49 public LcmCommonHeader getCommonHeader() {
58 public String getAction() {
65 * @param action the action to set
67 public void setAction(String action) {
72 * Get the action identifiers.
74 * @return the actionIdentifiers
76 public Map<String, String> getActionIdentifiers() {
77 return actionIdentifiers;
81 * Set the action identifiers.
83 * @param actionIdentifiers the actionIdentifiers to set
85 public void setActionIdentifiers(Map<String, String> actionIdentifiers) {
86 this.actionIdentifiers = actionIdentifiers;
94 public String getPayload() {
101 * @param payload the payload to set
103 public void setPayload(String payload) {
104 this.payload = payload;
108 * Get the common header.
110 * @param commonHeader the commonHeader to set
112 public void setCommonHeader(LcmCommonHeader commonHeader) {
113 this.commonHeader = commonHeader;
117 public String toString() {
118 return "Request [commonHeader=" + commonHeader + ", action=" + action + ", actionIdentifiers="
119 + actionIdentifiers + ", payload=" + payload + "]";
123 public int hashCode() {
124 final int prime = 31;
126 result = prime * result + ((commonHeader == null) ? 0 : commonHeader.hashCode());
127 result = prime * result + ((action == null) ? 0 : action.hashCode());
128 result = prime * result + ((actionIdentifiers == null) ? 0 : actionIdentifiers.hashCode());
129 result = prime * result + ((payload == null) ? 0 : payload.hashCode());
134 public boolean equals(Object obj) {
141 if (getClass() != obj.getClass()) {
144 LcmRequest other = (LcmRequest) obj;
145 if (commonHeader == null) {
146 if (other.commonHeader != null) {
149 } else if (!commonHeader.equals(other.commonHeader)) {
152 if (action == null) {
153 if (other.action != null) {
156 } else if (!action.equals(other.action)) {
159 if (actionIdentifiers == null) {
160 if (other.actionIdentifiers != null) {
163 } else if (!actionIdentifiers.equals(other.actionIdentifiers)) {
166 if (payload == null) {
167 if (other.payload != null) {
170 } else if (!payload.equals(other.payload)) {