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.database.beans;
23 import javax.persistence.Column;
24 import javax.persistence.Entity;
25 import javax.persistence.FetchType;
26 import javax.persistence.GeneratedValue;
27 import javax.persistence.GenerationType;
28 import javax.persistence.Id;
29 import javax.persistence.JoinColumn;
30 import javax.persistence.ManyToOne;
31 import javax.persistence.Table;
32 import java.util.Objects;
33 import static org.onap.so.cnfm.lcm.database.beans.utils.Utils.toIndentedString;
37 * @author Gerard Nugent (gerard.nugent@est.tech)
41 @Table(name = "AS_LIFECYCLE_PARAM")
42 public class AsLifecycleParam {
45 @Column(name = "AS_LCP_ID", nullable = false)
46 @GeneratedValue(strategy = GenerationType.IDENTITY)
47 private Integer asLifecycleParamId;
49 @ManyToOne(fetch = FetchType.LAZY)
50 @JoinColumn(name = "AS_DEP_ITEM_INST_ID", nullable = false)
51 private AsDeploymentItem asDeploymentItemInst;
53 @Column(name = "LIFECYCLE_PARAM")
54 private String lifecycleParam;
56 public AsLifecycleParam() {
60 public void setAsLifecycleParamId(final Integer asLifecycleParamId) {
61 this.asLifecycleParamId = asLifecycleParamId;
64 public Integer getAsLifecycleParamId() {
65 return asLifecycleParamId;
68 public AsLifecycleParam asLifecycleParamId(final Integer asLifecycleParamId) {
69 this.asLifecycleParamId = asLifecycleParamId;
73 public AsDeploymentItem getAsDeploymentItemInst() {
74 return asDeploymentItemInst;
77 public void setAsDeploymentItemInst(final AsDeploymentItem asDeploymentItemInst) {
78 this.asDeploymentItemInst = asDeploymentItemInst;
81 public AsLifecycleParam asDeploymentItemInst(final AsDeploymentItem asDeploymentItemInst) {
82 this.asDeploymentItemInst = asDeploymentItemInst;
86 public String getLifecycleParam() {
87 return lifecycleParam;
90 public void setLifecycleParam(final String lifecycleParam) {
91 this.lifecycleParam = lifecycleParam;
94 public AsLifecycleParam asLifecycleParam(final String lifecycleParam) {
95 this.lifecycleParam = lifecycleParam;
101 public String toString() {
102 final StringBuilder sb = new StringBuilder();
103 sb.append("class AslifecycleParam {\n");
104 sb.append(" asLifecycleParamId: ").append(toIndentedString(asLifecycleParamId)).append("\n");
105 sb.append(" asDeploymentItemInstId: ")
106 .append(asDeploymentItemInst != null
107 ? toIndentedString(asDeploymentItemInst.getAsDeploymentItemInstId())
110 sb.append(" lifecycleParam: ").append(toIndentedString(lifecycleParam)).append("\n");
112 return sb.toString();
117 public boolean equals(final Object o) {
120 if (o == null || getClass() != o.getClass())
122 final AsLifecycleParam that = (AsLifecycleParam) o;
123 return Objects.equals(asLifecycleParamId, that.asLifecycleParamId)
124 && Objects.equals(asDeploymentItemInst, that.asDeploymentItemInst)
125 && Objects.equals(lifecycleParam, that.lifecycleParam);
129 public int hashCode() {
130 return Objects.hash(asLifecycleParamId, asDeploymentItemInst, lifecycleParam);