[SDC] rebase 1710 code
[sdc.git] / test-apis-ci / src / main / java / org / openecomp / sdc / ci / tests / tosca / datatypes / ToscaDefinition.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.ci.tests.tosca.datatypes;
22
23 import java.util.List;
24 import java.util.Map;
25
26 import org.yaml.snakeyaml.TypeDescription;
27
28 public class ToscaDefinition {
29
30         String tosca_definitions_version;
31         Map<String, String> metadata;
32 //      Map<String, ToscaImportsDefinition> imports;
33 //      TODO waiting for answer about imports representation
34         Object imports;
35         Map<String, ToscaNodeTypesDefinition> node_types;
36         ToscaTopologyTemplateDefinition topology_template;
37
38         public ToscaDefinition() {
39                 super();
40         }
41
42         @Override
43         public String toString() {
44                 return "ToscaDefinition [tosca_definitions_version=" + tosca_definitions_version + ", metadata=" + metadata + ", imports=" + imports + ", node_types=" + node_types + ", topology_template=" + topology_template + "]";
45         }
46
47         public String getTosca_definitions_version() {
48                 return tosca_definitions_version;
49         }
50
51         public void setTosca_definitions_version(String tosca_definitions_version) {
52                 this.tosca_definitions_version = tosca_definitions_version;
53         }
54
55         public Map<String, String> getMetadata() {
56                 return metadata;
57         }
58
59         public void setMetadata(Map<String, String> metadata) {
60                 this.metadata = metadata;
61         }
62
63         
64
65         
66 //      public Map<String,ToscaImportsDefinition> getImports() {
67 //              return (Map<String, ToscaImportsDefinition>) imports;
68 //      }
69 //
70 //      public void setImports(Map<String,ToscaImportsDefinition> imports) {
71 //              this.imports = imports;
72 //      }
73 //      
74 //      public List<ToscaImportsDefinition> getImports() {
75 //              return (List<ToscaImportsDefinition>) imports;
76 //      }
77 //
78 //      public void setImports(List<ToscaImportsDefinition> imports) {
79 //              this.imports = imports;
80 //      }
81
82         public Object getImports() {
83                 return imports;
84         }
85
86         public void setImports(Object imports) {
87                 this.imports = imports;
88         }
89
90         public Map<String, ToscaNodeTypesDefinition> getNode_types() {
91                 return node_types;
92         }
93
94         public void setNode_types(Map<String, ToscaNodeTypesDefinition> node_types) {
95                 this.node_types = node_types;
96         }
97
98         public ToscaTopologyTemplateDefinition getTopology_template() {
99                 return topology_template;
100         }
101
102         public void setTopology_template(ToscaTopologyTemplateDefinition topology_template) {
103                 this.topology_template = topology_template;
104         }
105
106
107
108         //gets Type description for Yaml snake
109         public static TypeDescription getTypeDescription(){
110         TypeDescription typeDescription = new TypeDescription(ToscaDefinition.class);
111         typeDescription.putMapPropertyType("metadata", String.class, String.class);
112 //        TODO Andrey imports format
113         typeDescription.putMapPropertyType("imports", String.class, ToscaImportsDefinition.class);
114 //        typeDescription.putListPropertyType("imports", List.class);
115         typeDescription.putMapPropertyType("node_types", String.class, ToscaNodeTypesDefinition.class);
116         return typeDescription;
117         }
118         
119         
120 }