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.List;
26 import org.yaml.snakeyaml.TypeDescription;
30 public class ToscaGroupsTopologyTemplateDefinition {
32 private String type; // required
33 private String description;
34 // private Map<String, String> properties;
35 private ToscaGroupPropertyDefinition properties;
36 private Map<String, String> targets; // required
37 private Map<String, Object> interfaces;
38 private List<String> members;
39 // private Map<String, String> metadata;
40 private ToscaServiceGroupsMetadataDefinition metadata;
42 public ToscaGroupsTopologyTemplateDefinition() {
46 public ToscaServiceGroupsMetadataDefinition getMetadata() {
50 public void setMetadata(ToscaServiceGroupsMetadataDefinition metadata) {
51 this.metadata = metadata;
54 public String getType() {
58 public void setType(String type) {
62 public String getDescription() {
66 public void setDescription(String description) {
67 this.description = description;
70 // public Map<String, String> getProperties() {
74 // public void setProperties(Map<String, String> properties) {
75 // this.properties = properties;
78 public ToscaGroupPropertyDefinition getProperties() {
82 public void setProperties(ToscaGroupPropertyDefinition properties) {
83 this.properties = properties;
86 public Map<String, String> getTargets() {
90 public void setTargets(Map<String, String> targets) {
91 this.targets = targets;
94 public Map<String, Object> getInterfaces() {
98 public void setInterfaces(Map<String, Object> interfaces) {
99 this.interfaces = interfaces;
102 public List<String> getMembers() {
106 public void setMembers(List<String> members) {
107 this.members = members;
110 // public Map<String, String> getMetadata() {
114 // public void setMetadata(Map<String, String> metadata) {
115 // this.metadata = metadata;
119 public String toString() {
120 return "ToscaGroupsTopologyTemplateDefinition [type=" + type + ", description=" + description + ", properties=" + properties + ", targets=" + targets + ", interfaces=" + interfaces + ", members=" + members + ", metadata=" + metadata
124 //gets Type description for Yaml snake
125 public static TypeDescription getTypeDescription(){
126 TypeDescription typeDescription = new TypeDescription(ToscaGroupsTopologyTemplateDefinition.class);
127 // typeDescription.putMapPropertyType("properties", String.class, Object.class);
128 // typeDescription.putListPropertyType("properties", ToscaGroupPropertyDefinition.class);
129 typeDescription.putMapPropertyType("interfaces", String.class, Object.class);
130 typeDescription.putMapPropertyType("targets", String.class, Object.class);
131 // typeDescription.putMapPropertyType("metadata", String.class, String.class);
132 typeDescription.putMapPropertyType("metadata", String.class, String.class);
133 typeDescription.putListPropertyType("members", String.class);
134 return typeDescription;