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=========================================================
21 package org.onap.so.cnfm.lcm.bpmn.flows.tasks;
23 import static org.onap.so.cnfm.lcm.database.beans.utils.Utils.toIndentedString;
25 import java.io.Serializable;
26 import java.util.Comparator;
27 import java.util.Objects;
28 import org.jetbrains.annotations.NotNull;
32 * @author Raviteja Karumuri (raviteja.karumuri@est.tech)
35 public class TerminateDeploymentItemRequest implements Serializable, Comparable<TerminateDeploymentItemRequest> {
37 private static final long serialVersionUID = 2953758424937589468L;
38 private String asInstId;
39 private String asDeploymentItemInstId;
40 private String kubeConfigFile;
41 private Integer deploymentOrder;
42 private String releaseName;
44 private static final Comparator<Integer> COMPARATOR = Comparator.nullsFirst(Integer::compare).reversed();
46 public String getAsInstId() {
50 public void setAsInstId(final String asInstId) {
51 this.asInstId = asInstId;
54 public String getAsDeploymentItemInstId() {
55 return asDeploymentItemInstId;
58 public void setAsDeploymentItemInstId(final String asDeploymentItemInstId) {
59 this.asDeploymentItemInstId = asDeploymentItemInstId;
62 public String getKubeConfigFile() {
63 return kubeConfigFile;
66 public void setKubeConfigFile(final String kubeConfigFile) {
67 this.kubeConfigFile = kubeConfigFile;
70 public Integer getDeploymentOrder() {
71 return deploymentOrder;
74 public void setDeploymentOrder(final Integer deploymentOrder) {
75 this.deploymentOrder = deploymentOrder;
78 public String getReleaseName() {
82 public void setReleaseName(final String releaseName) {
83 this.releaseName = releaseName;
87 public boolean equals(final Object obj) {
88 if (obj instanceof TerminateDeploymentItemRequest) {
89 final TerminateDeploymentItemRequest that = (TerminateDeploymentItemRequest) obj;
90 return Objects.equals(asInstId, that.asInstId)
91 && Objects.equals(asDeploymentItemInstId, that.asDeploymentItemInstId)
92 && Objects.equals(kubeConfigFile, that.kubeConfigFile)
93 && Objects.equals(deploymentOrder, that.deploymentOrder)
94 && Objects.equals(releaseName, that.releaseName);
100 public int hashCode() {
101 return Objects.hash(asInstId, asDeploymentItemInstId, kubeConfigFile, deploymentOrder,
106 public int compareTo(@NotNull final TerminateDeploymentItemRequest terminateDeploymentItemRequest) {
107 return COMPARATOR.compare(this.getDeploymentOrder(), terminateDeploymentItemRequest.getDeploymentOrder());
111 public String toString() {
112 final StringBuilder sb = new StringBuilder();
113 sb.append("class TerminateDeploymentItemRequest {\n");
114 sb.append(" asInstId: ").append(toIndentedString(asInstId)).append("\n");
115 sb.append(" asDeploymentItemInstId: ").append(toIndentedString(asDeploymentItemInstId)).append("\n");
116 sb.append(" deploymentOrder: ").append(toIndentedString(deploymentOrder)).append("\n");
117 sb.append(" kubeConfigFile: ").append(toIndentedString(kubeConfigFile)).append("\n");
118 sb.append(" releaseName: ").append(toIndentedString(releaseName)).append("\n");
120 return sb.toString();