summaryrefslogtreecommitdiffstats
path: root/common-be/src/main/java
diff options
context:
space:
mode:
authorfranciscovila <javier.paradela.vila@est.tech>2023-03-21 16:54:46 +0000
committerMichael Morris <michael.morris@est.tech>2023-05-25 09:26:35 +0000
commit468d0770593e167990df815e45cde717bd845d18 (patch)
treef4f6fd1838bdca5afa60295726acdd41de677980 /common-be/src/main/java
parent871b9813322801509a566b49a1cdcc65c052de29 (diff)
Support TOSCA functions in operation inputs
Issue-ID: SDC-4442 Signed-off-by: franciscovila <javier.paradela.vila@est.tech> Change-Id: I1e6135da6f41d512a7758d5494df12da874d7146
Diffstat (limited to 'common-be/src/main/java')
-rw-r--r--common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaGetFunctionType.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaGetFunctionType.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaGetFunctionType.java
index d84c86a38d..c1895f3f80 100644
--- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaGetFunctionType.java
+++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/tosca/ToscaGetFunctionType.java
@@ -19,6 +19,8 @@
package org.openecomp.sdc.be.datatypes.tosca;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Optional;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -34,6 +36,16 @@ public enum ToscaGetFunctionType {
private final String functionName;
private final String propertyType;
+ private static final Map<String, ToscaGetFunctionType> BY_FUNCTION_NAME = new HashMap<>();
+ private static final Map<String, ToscaGetFunctionType> BY_PROPERTY_TYPE = new HashMap<>();
+
+ static {
+ for (ToscaGetFunctionType e : values()) {
+ BY_FUNCTION_NAME.put(e.functionName, e);
+ BY_PROPERTY_TYPE.put(e.propertyType, e);
+ }
+ }
+
/**
* Converts a {@link ToscaFunctionType} to a {@link ToscaGetFunctionType}
* @param toscaFunctionType the tosca function type to convert
@@ -52,4 +64,12 @@ public enum ToscaGetFunctionType {
}
}
+ public static ToscaGetFunctionType valueOfFunctionName(String functionName) {
+ return BY_FUNCTION_NAME.get(functionName);
+ }
+
+ public static ToscaGetFunctionType valueOfPropertyType(String propertyType) {
+ return BY_PROPERTY_TYPE.get(propertyType);
+ }
+
}