2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2023 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
20 package org.onap.so.cnfm.lcm.bpmn.flows.tasks;
22 import static org.onap.so.cnfm.lcm.database.beans.utils.Utils.toIndentedString;
23 import java.io.Serializable;
24 import java.util.Comparator;
26 import java.util.Objects;
30 * @author Waqas Ikram (waqas.ikram@est.tech)
33 public class InstantiateDeploymentItemRequest implements Serializable, Comparable<InstantiateDeploymentItemRequest> {
34 private static final long serialVersionUID = 6972854424933379019L;
36 private String asInstId;
37 private String asDeploymentItemInstId;
38 private String asDeploymentItemName;
39 private String helmArtifactFilePath;
40 private String kubeConfigFile;
41 private Integer deploymentOrder;
42 private Map<String, String> lifeCycleParameters;
43 private String releaseName;
45 private static final Comparator<Integer> COMPARATOR = Comparator.nullsFirst(Integer::compare);
47 public String getAsInstId() {
51 public void setAsInstId(final String asInstId) {
52 this.asInstId = asInstId;
55 public InstantiateDeploymentItemRequest asInstId(final String asInstId) {
56 this.asInstId = asInstId;
60 public String getAsDeploymentItemInstId() {
61 return asDeploymentItemInstId;
64 public void setAsDeploymentItemInstId(final String asDeploymentItemInstId) {
65 this.asDeploymentItemInstId = asDeploymentItemInstId;
68 public InstantiateDeploymentItemRequest asDeploymentItemInstId(final String asDeploymentItemInstId) {
69 this.asDeploymentItemInstId = asDeploymentItemInstId;
73 public String getAsDeploymentItemName() {
74 return asDeploymentItemName;
77 public void setAsDeploymentItemName(final String asDeploymentItemName) {
78 this.asDeploymentItemName = asDeploymentItemName;
81 public InstantiateDeploymentItemRequest asDeploymentItemName(final String asDeploymentItemName) {
82 this.asDeploymentItemName = asDeploymentItemName;
86 public String getHelmArtifactFilePath() {
87 return helmArtifactFilePath;
90 public void setHelmArtifactFilePath(final String helmArtifactFilePath) {
91 this.helmArtifactFilePath = helmArtifactFilePath;
94 public InstantiateDeploymentItemRequest helmArtifactFilePath(final String helmArtifactFilePath) {
95 this.helmArtifactFilePath = helmArtifactFilePath;
99 public Integer getDeploymentOrder() {
100 return deploymentOrder;
103 public void setDeploymentOrder(final Integer deploymentOrder) {
104 this.deploymentOrder = deploymentOrder;
107 public InstantiateDeploymentItemRequest deploymentOrder(final Integer deploymentOrder) {
108 this.deploymentOrder = deploymentOrder;
112 public String getReleaseName() {
116 public void setReleaseName(final String releaseName) {
117 this.releaseName = releaseName;
120 public InstantiateDeploymentItemRequest releaseName(final String releaseName) {
121 this.releaseName = releaseName;
125 public String getKubeConfigFile() {
126 return kubeConfigFile;
129 public void setKubeConfigFile(final String kubeConfigFile) {
130 this.kubeConfigFile = kubeConfigFile;
133 public InstantiateDeploymentItemRequest kubeConfigFile(final String kubeConfigFile) {
134 this.kubeConfigFile = kubeConfigFile;
138 public Map<String, String> getLifeCycleParameters() {
139 return lifeCycleParameters;
142 public void setLifeCycleParameters(final Map<String, String> lifeCycleParameters) {
143 this.lifeCycleParameters = lifeCycleParameters;
146 public InstantiateDeploymentItemRequest lifeCycleParameters(final Map<String, String> lifeCycleParameters) {
147 this.lifeCycleParameters = lifeCycleParameters;
152 public int hashCode() {
153 return Objects.hash(asInstId, asDeploymentItemInstId, asDeploymentItemName, helmArtifactFilePath,
154 deploymentOrder, kubeConfigFile, lifeCycleParameters, releaseName);
158 public int compareTo(final InstantiateDeploymentItemRequest other) {
159 return COMPARATOR.compare(this.getDeploymentOrder(), other.getDeploymentOrder());
163 public boolean equals(final Object obj) {
164 if (obj instanceof InstantiateDeploymentItemRequest) {
165 final InstantiateDeploymentItemRequest other = (InstantiateDeploymentItemRequest) obj;
166 return Objects.equals(asInstId, other.asInstId)
167 && Objects.equals(asDeploymentItemInstId, other.asDeploymentItemInstId)
168 && Objects.equals(asDeploymentItemName, other.asDeploymentItemName)
169 && Objects.equals(helmArtifactFilePath, other.helmArtifactFilePath)
170 && Objects.equals(deploymentOrder, other.deploymentOrder)
171 && Objects.equals(kubeConfigFile, other.kubeConfigFile)
172 && Objects.equals(lifeCycleParameters, other.lifeCycleParameters)
173 && Objects.equals(releaseName, other.releaseName);
179 public String toString() {
180 final StringBuilder sb = new StringBuilder();
181 sb.append("class InstantiateDeploymentItemRequest {\n");
182 sb.append(" asInstId: ").append(toIndentedString(asInstId)).append("\n");
183 sb.append(" asDeploymentItemInstId: ").append(toIndentedString(asDeploymentItemInstId)).append("\n");
184 sb.append(" asDeploymentItemName: ").append(toIndentedString(asDeploymentItemName)).append("\n");
185 sb.append(" helmArtifactFilePath: ").append(toIndentedString(helmArtifactFilePath)).append("\n");
186 sb.append(" deploymentOrder: ").append(toIndentedString(deploymentOrder)).append("\n");
187 sb.append(" kubeConfigFile: ").append(toIndentedString(kubeConfigFile)).append("\n");
188 sb.append(" LifeCycleParameters: ").append(toIndentedString(lifeCycleParameters)).append("\n");
189 sb.append(" releaseName: ").append(toIndentedString(releaseName)).append("\n");
191 return sb.toString();