[SDC-29] rebase continue work to align source
[sdc.git] / test-apis-ci / src / main / java / org / openecomp / sdc / ci / tests / datatypes / enums / PropertyTypeEnum.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.datatypes.enums;
22
23 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
24 import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
25 import org.openecomp.sdc.be.model.PropertyDefinition;
26 import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
27
28 public enum PropertyTypeEnum {
29         INTEGER("defaultIntegerPropName1", "integer", "125", "default integer type property description", null), 
30         STRING("defaultStringPropName1", "string", "string", "default string type property description", null), 
31         BOOLEAN("defaultBooleanPropName1", "boolean", "true", "default boolean type property description", null),
32         FLOAT("defaultBooleanPropName1", "float", "1.2", "default float type property description", null),
33         STRING_LIST("defaultStringListPropName", "list", "[a,b]", "outer description", getDefaultStringSchema(ToscaPropertyType.STRING.getType())), 
34         INTEGER_LIST("defaultIntegerListPropName", "list", "[1,2]", "outer description", getDefaultStringSchema(ToscaPropertyType.INTEGER.getType())), 
35         BOOLEAN_LIST("defaultBooleanListPropName", "list", "[true,false]", "outer description", getDefaultStringSchema(ToscaPropertyType.BOOLEAN.getType())), 
36         FLOAT_LIST("defaultFloatMapPropName", "list", "[1.0,2.0]", "outer description", getDefaultStringSchema(ToscaPropertyType.FLOAT.getType())), 
37         STRING_MAP("defaultStringMapPropName", "map", "{\"key1\":val1 , \"key2\":val2}", "outer description", getDefaultStringSchema(ToscaPropertyType.STRING.getType())), 
38         INTEGER_MAP("defaultIntegerMapPropName", "map", "{\"key1\":123 , \"key2\":-456}", "outer description", getDefaultStringSchema(ToscaPropertyType.INTEGER.getType())), 
39         BOOLEAN_MAP("defaultBooleanMapPropName", "map", "{\"key1\":true , \"key2\":false}", "outer description", getDefaultStringSchema(ToscaPropertyType.BOOLEAN.getType())), 
40         FLOAT_MAP("defaultFloatMapPropName", "map", "{\"key1\":0.2123 , \"key2\":43.545f}", "outer description", getDefaultStringSchema(ToscaPropertyType.FLOAT.getType()));
41
42         private String name;
43         private String type;
44         private String value;
45         private String description;
46         private SchemaDefinition schemaDefinition;
47
48         private PropertyTypeEnum(String name, String type, String value, String description,
49                         SchemaDefinition schemaDefinition) {
50                 this.name = name;
51                 this.type = type;
52                 this.value = value;
53                 this.description = description;
54                 this.schemaDefinition = schemaDefinition;
55         }
56
57         public String getName() {
58                 return name;
59         }
60
61         public void setName(String name) {
62                 this.name = name;
63         }
64
65         public String getType() {
66                 return type;
67         }
68
69         public void setType(String type) {
70                 this.type = type;
71         }
72
73         public String getValue() {
74                 return value;
75         }
76
77         public void setValue(String value) {
78                 this.value = value;
79         }
80
81         public String getDescription() {
82                 return description;
83         }
84
85         public void setDescription(String description) {
86                 this.description = description;
87         }
88
89         public SchemaDefinition getSchemaDefinition() {
90                 return schemaDefinition;
91         }
92
93         public void setSchemaDefinition(SchemaDefinition schemaDefinition) {
94                 this.schemaDefinition = schemaDefinition;
95         }
96
97         private static SchemaDefinition getDefaultStringSchema(String innerType) {
98                 SchemaDefinition schema = new SchemaDefinition();
99                 String description = "inner description";
100                 PropertyDefinition property = new PropertyDefinition();
101                 property.setType(innerType);
102                 property.setDescription(description);
103                 schema.setProperty(property);
104                 return schema;
105         }
106
107 }