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