c3b11f2666696c819c5ff0f37f884f71b8a7b415
[sdc.git] /
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.ci.tests.tosca.datatypes;
22
23 import java.util.ArrayList;
24 import java.util.List;
25 import java.util.Map;
26
27 import org.yaml.snakeyaml.TypeDescription;
28
29 import com.google.gson.annotations.SerializedName;
30
31 public class ToscaInputsTopologyTemplateDefinition {
32         
33         public String name;
34         public String type;
35         public String description;
36         public Boolean required;
37         public Boolean hidden;
38         public Boolean immutable;
39         @SerializedName("default")
40         public Object Default;
41
42         public String status;
43         public List<Object> constraints = new ArrayList<Object>();
44         public Map<String, Object> entry_schema;
45         public Object value;
46
47         public ToscaInputsTopologyTemplateDefinition(String name, String type, String description, Boolean required, Object default1, String status, List<Object> constraints, Map<String, Object> entry_schema, Object value, Boolean immutable, Boolean hidden) {
48                 super();
49                 this.name = name;
50                 this.type = type;
51                 this.description = description;
52                 this.required = required;
53                 Default = default1;
54                 this.status = status;
55                 this.constraints = constraints;
56                 this.entry_schema = entry_schema;
57                 this.value = value;
58                 this.immutable = immutable;
59                 this.hidden = hidden;
60         }
61
62         public ToscaInputsTopologyTemplateDefinition() {
63         }
64         public ToscaInputsTopologyTemplateDefinition(ToscaInputsTopologyTemplateDefinition definition){
65 //              this(definition.getName(), definition.getType(), definition.getDescription(), definition.getRequired(), definition.getDefault(), definition.getStatus(), definition.getConstraints(), definition.getEntry_schema(), definition.getValue());
66                 this.name = definition.name;
67                 this.type = definition.type;
68                 this.description = definition.description;
69                 this.required = definition.required;
70                 this.Default = definition.Default;
71                 this.status = definition.status;
72                 this.constraints = definition.constraints;
73                 this.entry_schema = definition.entry_schema;
74                 this.value = definition.value;
75                 this.immutable = immutable;
76                 this.hidden = hidden;
77         }
78         
79         public Boolean getHidden() {
80                 return hidden;
81         }
82
83         public void setHidden(Boolean hidden) {
84                 this.hidden = hidden;
85         }
86
87         public Boolean getImmutable() {
88                 return immutable;
89         }
90
91         public void setImmutable(Boolean immutable) {
92                 this.immutable = immutable;
93         }
94
95         public String getName() {
96                 return name;
97         }
98
99         public void setName(String name) {
100                 this.name = name;
101         }
102
103         public String getType() {
104                 return type;
105         }
106
107         public void setType(String type) {
108                 this.type = type;
109         }
110
111         public String getDescription() {
112                 return description;
113         }
114
115         public void setDescription(String description) {
116                 this.description = description;
117         }
118
119         public Boolean getRequired() {
120                 return required;
121         }
122
123         public void setRequired(Boolean required) {
124                 this.required = required;
125         }
126
127         public Object getDefault() {
128                 return Default;
129         }
130
131         public void setDefault(Object default1) {
132                 Default = default1;
133         }
134
135         public String getStatus() {
136                 return status;
137         }
138
139         public void setStatus(String status) {
140                 this.status = status;
141         }
142
143         public List<Object> getConstraints() {
144                 return constraints;
145         }
146
147         public void setConstraints(List<Object> constraints) {
148                 this.constraints = constraints;
149         }
150
151         public Map<String, Object> getEntry_schema() {
152                 return entry_schema;
153         }
154
155         public void setEntry_schema(Map<String, Object> entry_schema) {
156                 this.entry_schema = entry_schema;
157         }
158
159         public Object getValue() {
160                 return value;
161         }
162
163         public void setValue(Object value) {
164                 this.value = value;
165         }
166
167         //gets Type description for Yaml snake
168         public static TypeDescription getTypeDescription(){
169         TypeDescription typeDescription = new TypeDescription(ToscaInputsTopologyTemplateDefinition.class);
170         typeDescription.putListPropertyType("constraints", Object.class);
171         typeDescription.putMapPropertyType("entry_schema", String.class, Object.class);
172         return typeDescription;
173         }
174
175         @Override
176         public int hashCode() {
177                 final int prime = 31;
178                 int result = 1;
179                 result = prime * result + ((Default == null) ? 0 : Default.hashCode());
180                 result = prime * result + ((constraints == null) ? 0 : constraints.hashCode());
181                 result = prime * result + ((description == null) ? 0 : description.hashCode());
182                 result = prime * result + ((entry_schema == null) ? 0 : entry_schema.hashCode());
183                 result = prime * result + ((hidden == null) ? 0 : hidden.hashCode());
184                 result = prime * result + ((immutable == null) ? 0 : immutable.hashCode());
185                 result = prime * result + ((name == null) ? 0 : name.hashCode());
186                 result = prime * result + ((required == null) ? 0 : required.hashCode());
187                 result = prime * result + ((status == null) ? 0 : status.hashCode());
188                 result = prime * result + ((type == null) ? 0 : type.hashCode());
189                 result = prime * result + ((value == null) ? 0 : value.hashCode());
190                 return result;
191         }
192
193         @Override
194         public boolean equals(Object obj) {
195                 if (this == obj)
196                         return true;
197                 if (obj == null)
198                         return false;
199                 if (getClass() != obj.getClass())
200                         return false;
201                 ToscaInputsTopologyTemplateDefinition other = (ToscaInputsTopologyTemplateDefinition) obj;
202                 if (Default == null) {
203                         if (other.Default != null)
204                                 return false;
205                 } else if (!Default.equals(other.Default))
206                         return false;
207                 if (constraints == null) {
208                         if (other.constraints != null)
209                                 return false;
210                 } else if (!constraints.equals(other.constraints))
211                         return false;
212                 if (description == null) {
213                         if (other.description != null)
214                                 return false;
215                 } else if (!description.equals(other.description))
216                         return false;
217                 if (entry_schema == null) {
218                         if (other.entry_schema != null)
219                                 return false;
220                 } else if (!entry_schema.equals(other.entry_schema))
221                         return false;
222                 if (hidden == null) {
223                         if (other.hidden != null)
224                                 return false;
225                 } else if (!hidden.equals(other.hidden))
226                         return false;
227                 if (immutable == null) {
228                         if (other.immutable != null)
229                                 return false;
230                 } else if (!immutable.equals(other.immutable))
231                         return false;
232                 if (name == null) {
233                         if (other.name != null)
234                                 return false;
235                 } else if (!name.equals(other.name))
236                         return false;
237                 if (required == null) {
238                         if (other.required != null)
239                                 return false;
240                 } else if (!required.equals(other.required))
241                         return false;
242                 if (status == null) {
243                         if (other.status != null)
244                                 return false;
245                 } else if (!status.equals(other.status))
246                         return false;
247                 if (type == null) {
248                         if (other.type != null)
249                                 return false;
250                 } else if (!type.equals(other.type))
251                         return false;
252                 if (value == null) {
253                         if (other.value != null)
254                                 return false;
255                 } else if (!value.equals(other.value))
256                         return false;
257                 return true;
258         }
259
260 }