diff options
Diffstat (limited to 'common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaFunctionType.java')
-rw-r--r-- | common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaFunctionType.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaFunctionType.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaFunctionType.java index 4579ac2410..2636c4f6d7 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaFunctionType.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/ToscaFunctionType.java @@ -25,6 +25,7 @@ import java.util.Arrays; import java.util.Optional; import lombok.AllArgsConstructor; import lombok.Getter; +import org.apache.commons.lang3.StringUtils; @AllArgsConstructor @Getter @@ -40,6 +41,9 @@ public enum ToscaFunctionType { private final String name; public static Optional<ToscaFunctionType> findType(final String functionType) { + if (StringUtils.isBlank(functionType)) { + return Optional.empty(); + } return Arrays.stream(values()).filter(toscaFunctionType -> toscaFunctionType.getName().equalsIgnoreCase(functionType)).findFirst(); } } |