[SDC-29] rebase continue work to align source
[sdc.git] / test-apis-ci / src / main / java / org / openecomp / sdc / ci / tests / datatypes / PropertyReqDetails.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;
22
23 import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
24
25 public class PropertyReqDetails {
26         String name;
27         String type;
28         Boolean required = false;
29         String defaultValue;
30         String description;
31         String propertyRangeMin;
32         String propertyRangeMax;
33         Boolean isPassword = false;
34         SchemaDefinition schema;
35
36         public PropertyReqDetails() {
37                 super();
38         }
39
40         public PropertyReqDetails(String propertyName, String propertyType, Boolean propertyRequired,
41                         String propertyDefaultValue, String propertyDescription, String propertyRangeMin, String propertyRangeMax,
42                         Boolean propertyPassword) {
43                 super();
44                 this.name = propertyName;
45                 this.type = propertyType;
46                 this.required = propertyRequired;
47                 this.defaultValue = propertyDefaultValue;
48                 this.description = propertyDescription;
49                 this.propertyRangeMin = propertyRangeMin;
50                 this.propertyRangeMax = propertyRangeMax;
51                 this.isPassword = propertyPassword;
52         }
53
54         public PropertyReqDetails(String propertyName, String propertyType, String propertyDefaultValue,
55                         String propertyDescription, SchemaDefinition schema) {
56                 super();
57                 this.name = propertyName;
58                 this.type = propertyType;
59                 this.defaultValue = propertyDefaultValue;
60                 this.description = propertyDescription;
61                 this.schema = schema;
62         }
63
64         public SchemaDefinition getSchema() {
65                 return schema;
66         }
67
68         public void setSchema(SchemaDefinition schema) {
69                 this.schema = schema;
70         }
71
72         public String getName() {
73                 return name;
74         }
75
76         public void setName(String propertyName) {
77                 this.name = propertyName;
78         }
79
80         public String getPropertyType() {
81                 return type;
82         }
83
84         public void setPropertyType(String propertyType) {
85                 this.type = propertyType;
86         }
87
88         public Boolean getPropertyRequired() {
89                 return required;
90         }
91
92         public void setPropertyRequired(Boolean propertyRequired) {
93                 this.required = propertyRequired;
94         }
95
96         public String getPropertyDefaultValue() {
97                 return defaultValue;
98         }
99
100         public void setPropertyDefaultValue(String propertyDefaultValue) {
101                 this.defaultValue = propertyDefaultValue;
102         }
103
104         public String getPropertyDescription() {
105                 return description;
106         }
107
108         public void setPropertyDescription(String propertyDescription) {
109                 this.description = propertyDescription;
110         }
111
112         public String getPropertyRangeMin() {
113                 return propertyRangeMin;
114         }
115
116         public void setPropertyRangeMin(String propertyRangeMin) {
117                 this.propertyRangeMin = propertyRangeMin;
118         }
119
120         public String getPropertyRangeMax() {
121                 return propertyRangeMax;
122         }
123
124         public void setPropertyRangeMax(String propertyRangeMax) {
125                 this.propertyRangeMax = propertyRangeMax;
126         }
127
128         public Boolean getPropertyPassword() {
129                 return isPassword;
130         }
131
132         public void setPropertyPassword(Boolean propertyPassword) {
133                 this.isPassword = propertyPassword;
134         }
135
136         public String propertyToJsonString() {
137                 String jsonString;
138                 jsonString = "{\"" + this.getName() + "\":{" + "\"type\":\"" + this.getPropertyType() + "\"," + "\"required\":"
139                                 + this.getPropertyRequired() + "," + "\"defaultValue\":\"" + this.getPropertyDefaultValue() + "\","
140                                 + "\"description\":\"" + this.getPropertyDescription() + "\"," + "\"constraints\":[{\"inRange\":[\""
141                                 + this.getPropertyRangeMin() + "\",\"" + this.getPropertyRangeMax() + "\"]}]," + "\"isPassword\":"
142                                 + this.getPropertyPassword() + "}}";
143                 return jsonString;
144         }
145 }