Containerization feature of SO
[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
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.Id;
28 import javax.persistence.IdClass;
29 import javax.persistence.Table;
30
31 import org.apache.commons.lang3.builder.EqualsBuilder;
32 import org.apache.commons.lang3.builder.HashCodeBuilder;
33 import org.apache.commons.lang3.builder.ToStringBuilder;
34
35 import com.openpojo.business.annotation.BusinessKey;
36
37 @IdClass(HeatTemplateParamId.class)
38 @Entity
39 @Table(name = "heat_template_params")
40 public class HeatTemplateParam implements Serializable {
41
42         @BusinessKey
43         @Id
44         @Column(name = "HEAT_TEMPLATE_ARTIFACT_UUID")
45         private String heatTemplateArtifactUuid;
46
47         @BusinessKey
48         @Id
49         @Column(name = "PARAM_NAME")
50         private String paramName;
51
52         @Column(name = "IS_REQUIRED")
53         private Boolean required;
54
55         @Column(name = "PARAM_TYPE")
56         private String paramType;
57
58         @Column(name = "PARAM_ALIAS")
59         private String paramAlias;
60
61         public static final long serialVersionUID = -1322322139926390329L;
62
63         @Override
64         public String toString() {
65                 return new ToStringBuilder(this).append("heatTemplateArtifactUuid", heatTemplateArtifactUuid)
66                                 .append("paramName", paramName).append("required", required).append("paramType", paramType)
67                                 .append("paramAlias", paramAlias).toString();
68         }
69
70         @Override
71         public boolean equals(final Object other) {
72                 if (!(other instanceof HeatTemplateParam)) {
73                         return false;
74                 }
75                 HeatTemplateParam castOther = (HeatTemplateParam) other;
76                 return new EqualsBuilder().append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid)
77                                 .append(paramName, castOther.paramName).isEquals();
78         }
79
80         @Override
81         public int hashCode() {
82                 return new HashCodeBuilder().append(heatTemplateArtifactUuid).append(paramName).toHashCode();
83         }
84
85         public String getHeatTemplateArtifactUuid() {
86                 return this.heatTemplateArtifactUuid;
87         }
88
89         public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) {
90                 this.heatTemplateArtifactUuid = heatTemplateArtifactUuid;
91         }
92
93         public String getParamName() {
94                 return paramName;
95         }
96
97         public void setParamName(String paramName) {
98                 this.paramName = paramName;
99         }
100
101         public Boolean isRequired() {
102                 return required;
103         }
104
105         public void setRequired(Boolean required) {
106                 this.required = required;
107         }
108
109         public String getParamAlias() {
110                 return paramAlias;
111         }
112
113         public void setParamAlias(String paramAlias) {
114                 this.paramAlias = paramAlias;
115         }
116
117         public String getParamType() {
118                 return paramType;
119         }
120
121         public void setParamType(String paramType) {
122                 this.paramType = paramType;
123         }
124 }