aboutsummaryrefslogtreecommitdiffstats
path: root/common/openecomp-tosca-datatype
diff options
context:
space:
mode:
authorojasdubey <ojas.dubey@amdocs.com>2018-02-22 14:32:06 +0530
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-02-28 09:56:30 +0000
commit51e051e86f9f5d10c9439e9e5e57d1e9ee8f8e06 (patch)
tree957583dc6b93667d7024c7258716d6c6b96776c2 /common/openecomp-tosca-datatype
parentbc169d4b132891052cc8c642e18e642afd04464f (diff)
VLAN tagging - Pattern 1A, 1C1
1. Implementation for supporting VLAN tagging in Pattern 1A and 1C1 heats 2. Updated code for switch case refactor with command design pattern 3. Added unit tests and bug fixes Change-Id: I54938ffd6673f865b4506a890ec8e7b9c54597b1 Issue-ID: SDC-1036 Signed-off-by: ojasdubey <ojas.dubey@amdocs.com>
Diffstat (limited to 'common/openecomp-tosca-datatype')
-rw-r--r--common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java35
1 files changed, 24 insertions, 11 deletions
diff --git a/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java
index bebf6d34bf..02c4b7fde4 100644
--- a/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java
+++ b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/PropertyType.java
@@ -1,28 +1,26 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
*/
package org.openecomp.sdc.tosca.datatypes.model;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
public enum PropertyType {
@@ -39,6 +37,8 @@ public enum PropertyType {
private static final Map<String, PropertyType> mMap =
Collections.unmodifiableMap(initializeMapping());
+ private static final Set<String> simplePropertyTypes =
+ Collections.unmodifiableSet(initializeSimplePropertyTypes());
private String displayName;
PropertyType(String displayName) {
@@ -51,7 +51,7 @@ public enum PropertyType {
* @return Map
*/
public static Map<String, PropertyType> initializeMapping() {
- Map<String, PropertyType> typeMap = new HashMap<String, PropertyType>();
+ Map<String, PropertyType> typeMap = new HashMap<>();
for (PropertyType v : PropertyType.values()) {
typeMap.put(v.displayName, v);
}
@@ -60,7 +60,7 @@ public enum PropertyType {
/**
* Get Property type by display name.
- * @param displayName.
+ * @param displayName
* @return PropertyType
*/
public static PropertyType getPropertyTypeByDisplayName(String displayName) {
@@ -73,6 +73,19 @@ public enum PropertyType {
return null;
}
+ private static Set<String> initializeSimplePropertyTypes() {
+ Set<String> simplePropertyTypes = new HashSet<>(4);
+ simplePropertyTypes.add(STRING.getDisplayName().toLowerCase());
+ simplePropertyTypes.add(INTEGER.getDisplayName().toLowerCase());
+ simplePropertyTypes.add(FLOAT.getDisplayName().toLowerCase());
+ simplePropertyTypes.add(BOOLEAN.getDisplayName().toLowerCase());
+ return simplePropertyTypes;
+ }
+
+ public static Set<String> getSimplePropertyTypes() {
+ return simplePropertyTypes;
+ }
+
public String getDisplayName() {
return displayName;
}