[SDC-29] catalog 1707 rebase commit.
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / HeatParameterDataDefinition.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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.openecomp.sdc.be.datatypes.elements;
22
23 import java.io.Serializable;
24
25 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
26
27 public class HeatParameterDataDefinition extends ToscaDataDefinition implements Serializable {
28
29         /**
30          * 
31          */
32         private static final long serialVersionUID = 8995421762148502848L;
33
34         String uniqueId;
35
36         String name;
37         String type;
38         String description;
39
40         String currentValue;
41         String defaultValue;
42
43         public HeatParameterDataDefinition() {
44         }
45
46         public HeatParameterDataDefinition(HeatParameterDataDefinition hp) {
47                 this.uniqueId = hp.uniqueId;
48                 this.name = hp.name;
49                 this.type = hp.type;
50                 this.description = hp.description;
51                 this.currentValue = hp.currentValue;
52                 this.defaultValue = hp.defaultValue;
53         }
54
55         public String getUniqueId() {
56                 return uniqueId;
57         }
58
59         public void setUniqueId(String uniqueId) {
60                 this.uniqueId = uniqueId;
61         }
62
63         public String getName() {
64                 return name;
65         }
66
67         public void setName(String name) {
68                 this.name = name;
69         }
70
71         public String getType() {
72                 return type;
73         }
74
75         public void setType(String type) {
76                 this.type = type;
77         }
78
79         public String getDescription() {
80                 return description;
81         }
82
83         public void setDescription(String description) {
84                 this.description = description;
85         }
86
87         public String getCurrentValue() {
88                 return currentValue;
89         }
90
91         public void setCurrentValue(String currentValue) {
92                 this.currentValue = currentValue;
93         }
94
95         public String getDefaultValue() {
96                 return defaultValue;
97         }
98
99         public void setDefaultValue(String defaultValue) {
100                 this.defaultValue = defaultValue;
101         }
102
103         @Override
104         public String toString() {
105                 return "HeatParameterDataDefinition [uniqueId=" + uniqueId + ", name=" + name + ", type=" + type
106                                 + ", description=" + description + ", currentValue=" + currentValue + ", defaultValue=" + defaultValue
107                                 + "]";
108         }
109
110         @Override
111         public int hashCode() {
112                 final int prime = 31;
113                 int result = 1;
114                 result = prime * result + ((currentValue == null) ? 0 : currentValue.hashCode());
115                 result = prime * result + ((defaultValue == null) ? 0 : defaultValue.hashCode());
116                 result = prime * result + ((description == null) ? 0 : description.hashCode());
117                 result = prime * result + ((name == null) ? 0 : name.hashCode());
118                 result = prime * result + ((type == null) ? 0 : type.hashCode());
119                 result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
120                 return result;
121         }
122
123         @Override
124         public boolean equals(Object obj) {
125                 if (this == obj)
126                         return true;
127                 if (obj == null)
128                         return false;
129                 if (getClass() != obj.getClass())
130                         return false;
131                 HeatParameterDataDefinition other = (HeatParameterDataDefinition) obj;
132                 if (currentValue == null) {
133                         if (other.currentValue != null)
134                                 return false;
135                 } else if (!currentValue.equals(other.currentValue))
136                         return false;
137                 if (defaultValue == null) {
138                         if (other.defaultValue != null)
139                                 return false;
140                 } else if (!defaultValue.equals(other.defaultValue))
141                         return false;
142                 if (description == null) {
143                         if (other.description != null)
144                                 return false;
145                 } else if (!description.equals(other.description))
146                         return false;
147                 if (name == null) {
148                         if (other.name != null)
149                                 return false;
150                 } else if (!name.equals(other.name))
151                         return false;
152                 if (type == null) {
153                         if (other.type != null)
154                                 return false;
155                 } else if (!type.equals(other.type))
156                         return false;
157                 if (uniqueId == null) {
158                         if (other.uniqueId != null)
159                                 return false;
160                 } else if (!uniqueId.equals(other.uniqueId))
161                         return false;
162                 return true;
163         }
164 }