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 java.util.ArrayList;
24 import java.util.List;
27 import org.yaml.snakeyaml.TypeDescription;
29 import com.google.gson.annotations.SerializedName;
31 public class ToscaInputsTopologyTemplateDefinition {
35 public String description;
36 public Boolean required;
37 public Boolean hidden;
38 public Boolean immutable;
39 @SerializedName("default")
40 public Object Default;
43 public List<Object> constraints = new ArrayList<Object>();
44 public Map<String, Object> entry_schema;
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) {
51 this.description = description;
52 this.required = required;
55 this.constraints = constraints;
56 this.entry_schema = entry_schema;
58 this.immutable = immutable;
62 public ToscaInputsTopologyTemplateDefinition() {
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;
79 public Boolean getHidden() {
83 public void setHidden(Boolean hidden) {
87 public Boolean getImmutable() {
91 public void setImmutable(Boolean immutable) {
92 this.immutable = immutable;
95 public String getName() {
99 public void setName(String name) {
103 public String getType() {
107 public void setType(String type) {
111 public String getDescription() {
115 public void setDescription(String description) {
116 this.description = description;
119 public Boolean getRequired() {
123 public void setRequired(Boolean required) {
124 this.required = required;
127 public Object getDefault() {
131 public void setDefault(Object default1) {
135 public String getStatus() {
139 public void setStatus(String status) {
140 this.status = status;
143 public List<Object> getConstraints() {
147 public void setConstraints(List<Object> constraints) {
148 this.constraints = constraints;
151 public Map<String, Object> getEntry_schema() {
155 public void setEntry_schema(Map<String, Object> entry_schema) {
156 this.entry_schema = entry_schema;
159 public Object getValue() {
163 public void setValue(Object value) {
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;
176 public int hashCode() {
177 final int prime = 31;
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());
194 public boolean equals(Object obj) {
199 if (getClass() != obj.getClass())
201 ToscaInputsTopologyTemplateDefinition other = (ToscaInputsTopologyTemplateDefinition) obj;
202 if (Default == null) {
203 if (other.Default != null)
205 } else if (!Default.equals(other.Default))
207 if (constraints == null) {
208 if (other.constraints != null)
210 } else if (!constraints.equals(other.constraints))
212 if (description == null) {
213 if (other.description != null)
215 } else if (!description.equals(other.description))
217 if (entry_schema == null) {
218 if (other.entry_schema != null)
220 } else if (!entry_schema.equals(other.entry_schema))
222 if (hidden == null) {
223 if (other.hidden != null)
225 } else if (!hidden.equals(other.hidden))
227 if (immutable == null) {
228 if (other.immutable != null)
230 } else if (!immutable.equals(other.immutable))
233 if (other.name != null)
235 } else if (!name.equals(other.name))
237 if (required == null) {
238 if (other.required != null)
240 } else if (!required.equals(other.required))
242 if (status == null) {
243 if (other.status != null)
245 } else if (!status.equals(other.status))
248 if (other.type != null)
250 } else if (!type.equals(other.type))
253 if (other.value != null)
255 } else if (!value.equals(other.value))