[SO] Release so 1.13.0 image
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / HeatTemplateParam.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.db.catalog.beans;
22
23 import java.io.Serializable;
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.Id;
27 import javax.persistence.IdClass;
28 import javax.persistence.Table;
29 import org.apache.commons.lang3.builder.EqualsBuilder;
30 import org.apache.commons.lang3.builder.HashCodeBuilder;
31 import org.apache.commons.lang3.builder.ToStringBuilder;
32 import com.openpojo.business.annotation.BusinessKey;
33 import uk.co.blackpepper.bowman.annotation.RemoteResource;
34
35 @IdClass(HeatTemplateParamId.class)
36 @Entity
37 @RemoteResource("/heatTemplateParam")
38 @Table(name = "heat_template_params")
39 public class HeatTemplateParam implements Serializable {
40
41     @BusinessKey
42     @Id
43     @Column(name = "HEAT_TEMPLATE_ARTIFACT_UUID")
44     private String heatTemplateArtifactUuid;
45
46     @BusinessKey
47     @Id
48     @Column(name = "PARAM_NAME")
49     private String paramName;
50
51     @Column(name = "IS_REQUIRED")
52     private Boolean required;
53
54     @Column(name = "PARAM_TYPE")
55     private String paramType;
56
57     @Column(name = "PARAM_ALIAS")
58     private String paramAlias;
59
60     public static final long serialVersionUID = -1322322139926390329L;
61
62     @Override
63     public String toString() {
64         return new ToStringBuilder(this).append("heatTemplateArtifactUuid", heatTemplateArtifactUuid)
65                 .append("paramName", paramName).append("required", required).append("paramType", paramType)
66                 .append("paramAlias", paramAlias).toString();
67     }
68
69     @Override
70     public boolean equals(final Object other) {
71         if (!(other instanceof HeatTemplateParam)) {
72             return false;
73         }
74         HeatTemplateParam castOther = (HeatTemplateParam) other;
75         return new EqualsBuilder().append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid)
76                 .append(paramName, castOther.paramName).isEquals();
77     }
78
79     @Override
80     public int hashCode() {
81         return new HashCodeBuilder().append(heatTemplateArtifactUuid).append(paramName).toHashCode();
82     }
83
84     public String getHeatTemplateArtifactUuid() {
85         return this.heatTemplateArtifactUuid;
86     }
87
88     public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) {
89         this.heatTemplateArtifactUuid = heatTemplateArtifactUuid;
90     }
91
92     public String getParamName() {
93         return paramName;
94     }
95
96     public void setParamName(String paramName) {
97         this.paramName = paramName;
98     }
99
100     public Boolean isRequired() {
101         return required;
102     }
103
104     public void setRequired(Boolean required) {
105         this.required = required;
106     }
107
108     public String getParamAlias() {
109         return paramAlias;
110     }
111
112     public void setParamAlias(String paramAlias) {
113         this.paramAlias = paramAlias;
114     }
115
116     public String getParamType() {
117         return paramType;
118     }
119
120     public void setParamType(String paramType) {
121         this.paramType = paramType;
122     }
123 }