2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.ci.tests.tosca.datatypes;
23 import com.google.gson.annotations.SerializedName;
24 import org.yaml.snakeyaml.TypeDescription;
26 import java.util.ArrayList;
27 import java.util.List;
30 public class ToscaInputsTopologyTemplateDefinition {
34 public String description;
35 public Boolean required;
36 public Boolean hidden;
37 public Boolean immutable;
38 @SerializedName("default")
39 public Object Default;
42 public List<Object> constraints = new ArrayList<>();
43 public Map<String, Object> entry_schema;
45 public Map<String, ToscaInputsAnnotation> annotations;
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, Map<String, ToscaInputsAnnotation> annotations) {
51 this.description = description;
52 this.required = required;
55 this.constraints = constraints;
56 this.entry_schema = entry_schema;
58 this.immutable = immutable;
60 this.annotations = annotations;
63 public ToscaInputsTopologyTemplateDefinition() {
65 public ToscaInputsTopologyTemplateDefinition(ToscaInputsTopologyTemplateDefinition definition){
66 // this(definition.getName(), definition.getType(), definition.getDescription(), definition.getRequired(), definition.getDefault(), definition.getStatus(), definition.getConstraints(), definition.getEntry_schema(), definition.getValue());
67 this.name = definition.name;
68 this.type = definition.type;
69 this.description = definition.description;
70 this.required = definition.required;
71 this.Default = definition.Default;
72 this.status = definition.status;
73 this.constraints = definition.constraints;
74 this.entry_schema = definition.entry_schema;
75 this.value = definition.value;
76 this.immutable = immutable;
80 public Boolean getHidden() {
84 public void setHidden(Boolean hidden) {
88 public Boolean getImmutable() {
92 public void setImmutable(Boolean immutable) {
93 this.immutable = immutable;
96 public String getName() {
100 public void setName(String name) {
104 public String getType() {
108 public void setType(String type) {
112 public String getDescription() {
116 public void setDescription(String description) {
117 this.description = description;
120 public Boolean getRequired() {
124 public void setRequired(Boolean required) {
125 this.required = required;
128 public Object getDefault() {
132 public void setDefault(Object default1) {
136 public String getStatus() {
140 public void setStatus(String status) {
141 this.status = status;
144 public List<Object> getConstraints() {
148 public void setConstraints(List<Object> constraints) {
149 this.constraints = constraints;
152 public Map<String, Object> getEntry_schema() {
156 public void setEntry_schema(Map<String, Object> entry_schema) {
157 this.entry_schema = entry_schema;
160 public Object getValue() {
164 public void setValue(Object value) {
168 public Map<String, ToscaInputsAnnotation> getAnnotations() {
172 public void setAnnotations(Map<String, ToscaInputsAnnotation> annotations) {
173 this.annotations = annotations;
176 //gets Type description for Yaml snake
177 public static TypeDescription getTypeDescription(){
178 TypeDescription typeDescription = new TypeDescription(ToscaInputsTopologyTemplateDefinition.class);
179 typeDescription.putListPropertyType("constraints", Object.class);
180 typeDescription.putMapPropertyType("entry_schema", String.class, Object.class);
181 typeDescription.putMapPropertyType("annotations", String.class, ToscaInputsAnnotation.class);
182 return typeDescription;
186 public int hashCode() {
187 final int prime = 31;
189 result = prime * result + ((Default == null) ? 0 : Default.hashCode());
190 result = prime * result + ((constraints == null) ? 0 : constraints.hashCode());
191 result = prime * result + ((description == null) ? 0 : description.hashCode());
192 result = prime * result + ((entry_schema == null) ? 0 : entry_schema.hashCode());
193 result = prime * result + ((hidden == null) ? 0 : hidden.hashCode());
194 result = prime * result + ((immutable == null) ? 0 : immutable.hashCode());
195 result = prime * result + ((name == null) ? 0 : name.hashCode());
196 result = prime * result + ((required == null) ? 0 : required.hashCode());
197 result = prime * result + ((status == null) ? 0 : status.hashCode());
198 result = prime * result + ((type == null) ? 0 : type.hashCode());
199 result = prime * result + ((value == null) ? 0 : value.hashCode());
204 public boolean equals(Object obj) {
209 if (getClass() != obj.getClass())
211 ToscaInputsTopologyTemplateDefinition other = (ToscaInputsTopologyTemplateDefinition) obj;
212 if (Default == null) {
213 if (other.Default != null)
215 } else if (!Default.equals(other.Default))
217 if (constraints == null) {
218 if (other.constraints != null)
220 } else if (!constraints.equals(other.constraints))
222 if (description == null) {
223 if (other.description != null)
225 } else if (!description.equals(other.description))
227 if (entry_schema == null) {
228 if (other.entry_schema != null)
230 } else if (!entry_schema.equals(other.entry_schema))
232 if (hidden == null) {
233 if (other.hidden != null)
235 } else if (!hidden.equals(other.hidden))
237 if (immutable == null) {
238 if (other.immutable != null)
240 } else if (!immutable.equals(other.immutable))
243 if (other.name != null)
245 } else if (!name.equals(other.name))
247 if (required == null) {
248 if (other.required != null)
250 } else if (!required.equals(other.required))
252 if (status == null) {
253 if (other.status != null)
255 } else if (!status.equals(other.status))
258 if (other.type != null)
260 } else if (!type.equals(other.type))
263 if (other.value != null)
265 } else if (!value.equals(other.value))