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.datatypes;
23 import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
25 public class PropertyReqDetails {
28 Boolean required = false;
31 String propertyRangeMin;
32 String propertyRangeMax;
33 Boolean isPassword = false;
34 SchemaDefinition schema;
36 public PropertyReqDetails() {
40 public PropertyReqDetails(String propertyName, String propertyType, Boolean propertyRequired,
41 String propertyDefaultValue, String propertyDescription, String propertyRangeMin, String propertyRangeMax,
42 Boolean propertyPassword) {
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;
54 public PropertyReqDetails(String propertyName, String propertyType, String propertyDefaultValue,
55 String propertyDescription, SchemaDefinition schema) {
57 this.name = propertyName;
58 this.type = propertyType;
59 this.defaultValue = propertyDefaultValue;
60 this.description = propertyDescription;
64 public SchemaDefinition getSchema() {
68 public void setSchema(SchemaDefinition schema) {
72 public String getName() {
76 public void setName(String propertyName) {
77 this.name = propertyName;
80 public String getPropertyType() {
84 public void setPropertyType(String propertyType) {
85 this.type = propertyType;
88 public Boolean getPropertyRequired() {
92 public void setPropertyRequired(Boolean propertyRequired) {
93 this.required = propertyRequired;
96 public String getPropertyDefaultValue() {
100 public void setPropertyDefaultValue(String propertyDefaultValue) {
101 this.defaultValue = propertyDefaultValue;
104 public String getPropertyDescription() {
108 public void setPropertyDescription(String propertyDescription) {
109 this.description = propertyDescription;
112 public String getPropertyRangeMin() {
113 return propertyRangeMin;
116 public void setPropertyRangeMin(String propertyRangeMin) {
117 this.propertyRangeMin = propertyRangeMin;
120 public String getPropertyRangeMax() {
121 return propertyRangeMax;
124 public void setPropertyRangeMax(String propertyRangeMax) {
125 this.propertyRangeMax = propertyRangeMax;
128 public Boolean getPropertyPassword() {
132 public void setPropertyPassword(Boolean propertyPassword) {
133 this.isPassword = propertyPassword;
136 public String propertyToJsonString() {
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() + "}}";