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.be.model.heat;
23 import org.openecomp.sdc.be.model.tosca.converters.*;
24 import org.openecomp.sdc.be.model.tosca.validators.*;
26 public enum HeatParameterType {
28 STRING("string", HeatStringValidator.getInstance(), HeatStringConverter.getInstance()),
30 BOOLEAN("boolean", HeatBooleanValidator.getInstance(), HeatBooleanConverter.getInstance()),
32 NUMBER("number", HeatNumberValidator.getInstance(), HeatNumberConverter.getInstance()),
34 JSON("json", HeatStringValidator.getInstance(), HeatJsonConverter.getInstance()),
36 COMMA_DELIMITED_LIST("comma_delimited_list", HeatCommaDelimitedListValidator.getInstance(),
37 HeatCommaDelimitedListConverter.getInstance());
40 private PropertyTypeValidator validator;
41 private PropertyValueConverter converter;
43 HeatParameterType(String type, PropertyTypeValidator validator, PropertyValueConverter converter) {
45 this.validator = validator;
46 this.converter = converter;
49 public String getType() {
53 public PropertyTypeValidator getValidator() {
57 public PropertyValueConverter getConverter() {
61 public static HeatParameterType isValidType(String typeName) {
62 if (typeName == null) {
66 for (HeatParameterType type : HeatParameterType.values()) {
67 if (type.getType().equals(typeName)) {