From c89f17af3cccff82d3f251e7fe73910ea8e26dbf Mon Sep 17 00:00:00 2001 From: rameshiyer27 Date: Wed, 16 Feb 2022 23:07:34 +0000 Subject: Fix return type of get node templates provider The return type for fetching node templates can be just a List of ToscaNodetemplates. Removing the map with node template keys as it provides redundant keys in the output. Issue-ID: POLICY-3832 Signed-off-by: zrrmmua Change-Id: I43d357fc24af9fd4d127cce139b6d21c53cc98d1 --- .../models/tosca/authorative/provider/AuthorativeToscaProvider.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'models-tosca/src/main') diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java index 2ec9ee2c8..b3284d987 100644 --- a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java +++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProvider.java @@ -652,15 +652,15 @@ public class AuthorativeToscaProvider { * @return the node templates found * @throws PfModelException on errors getting tosca node templates */ - public List> getToscaNodeTemplate( + public List getToscaNodeTemplate( @NonNull final PfDao dao, final String name, final String version) throws PfModelException { LOGGER.debug("->getNodeTemplate: name={}, version={}", name, version); - List> nodeTemplates = new ArrayList<>(); + List nodeTemplates = new ArrayList<>(); synchronized (providerLockObject) { new SimpleToscaProvider().getToscaNodeTemplates(dao, name, version) - .getConceptMap().forEach((key, value) -> nodeTemplates.add(Map.of(key, value.toAuthorative()))); + .getConceptMap().forEach((key, value) -> nodeTemplates.add(value.toAuthorative())); } LOGGER.debug("<-getNodeTemplate: name={}, version={}, nodeTemplates={}", name, version, -- cgit 1.2.3-korg