From af3fdfce91aeea1804c76a8571c102b78dde3794 Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Thu, 13 Apr 2023 08:28:45 +0100 Subject: UI support for default custom function names Issue-ID: SDC-4473 Signed-off-by: JvD_Ericsson Change-Id: Ie4d002989857029300f0cc88123a5616a453aef0 --- .../sdc/be/servlets/DefaultCustomToscaFunctionServlet.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'catalog-be') 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 defaultCustomToscaFunctionssMap = new HashMap<>(); try { - final List defaultCustomToscaFunction = getDefaultCustomToscaFunctionValues().stream() - .filter(func -> type.name().toLowerCase().equals(func.getType())).collect( - Collectors.toList()); + List 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} } -- cgit 1.2.3-korg