diff options
author | JvD_Ericsson <jeff.van.dam@est.tech> | 2023-04-13 08:28:45 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2023-05-04 15:43:18 +0000 |
commit | af3fdfce91aeea1804c76a8571c102b78dde3794 (patch) | |
tree | 208b175c5a4b4d9522bdd7577a34722daab25137 /catalog-be/src/main/java | |
parent | c4de5390c2a396e9ea88061454e40a92cea57ce1 (diff) |
UI support for default custom function names
Issue-ID: SDC-4473
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Change-Id: Ie4d002989857029300f0cc88123a5616a453aef0
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DefaultCustomToscaFunctionServlet.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DefaultCustomToscaFunctionServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DefaultCustomToscaFunctionServlet.java index 2ad2266ea2..f43e24791b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DefaultCustomToscaFunctionServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/DefaultCustomToscaFunctionServlet.java @@ -85,9 +85,12 @@ public class DefaultCustomToscaFunctionServlet extends BeGenericServlet { LOGGER.debug("Start handle request of {}", url); final Map<String, Object> defaultCustomToscaFunctionssMap = new HashMap<>(); try { - final List<Configuration.CustomToscaFunction> defaultCustomToscaFunction = getDefaultCustomToscaFunctionValues().stream() - .filter(func -> type.name().toLowerCase().equals(func.getType())).collect( - Collectors.toList()); + List<Configuration.CustomToscaFunction> defaultCustomToscaFunction = getDefaultCustomToscaFunctionValues(); + if (!type.equals(Type.ALL)) { + defaultCustomToscaFunction = defaultCustomToscaFunction.stream() + .filter(func -> type.name().toLowerCase().equals(func.getType())).collect( + Collectors.toList()); + } if (CollectionUtils.isEmpty(defaultCustomToscaFunction)) { return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.NO_CONTENT)); } @@ -106,5 +109,5 @@ public class DefaultCustomToscaFunctionServlet extends BeGenericServlet { return customFunctions == null ? Collections.emptyList() : customFunctions; } - public enum Type {CUSTOM, GET_INPUT} + public enum Type {ALL, CUSTOM, GET_INPUT} } |