From b43e8ebd9f3e7436a51c2a6b9fe71f254d92b833 Mon Sep 17 00:00:00 2001 From: talio Date: Sun, 28 Jan 2018 09:47:38 +0200 Subject: change capabilities datatype change node template capabilities datatype from list of map to map Change-Id: Ie0fa71b8a41ec732ae5290a72c4d8e908701ce17 Issue-ID: SDC-968 Signed-off-by: talio --- .../main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main') diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java index fd89faeb85..8da2fc8c54 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java @@ -1114,16 +1114,14 @@ public class DataModelUtil { public static void addNodeTemplateCapability(NodeTemplate nodeTemplate, String capabilityId, Map capabilityProperties, Map capabilityAttributes) { - List> capabilities = nodeTemplate.getCapabilities(); + Map capabilities = nodeTemplate.getCapabilities(); if (Objects.isNull(capabilities)) { - capabilities = new ArrayList<>(); + capabilities = new HashMap<>(); } CapabilityAssignment capabilityAssignment = new CapabilityAssignment(); capabilityAssignment.setProperties(capabilityProperties); capabilityAssignment.setAttributes(capabilityAttributes); - Map nodeTemplateCapability = new HashMap<>(); - nodeTemplateCapability.put(capabilityId, capabilityAssignment); - capabilities.add(nodeTemplateCapability); + capabilities.put(capabilityId, capabilityAssignment); nodeTemplate.setCapabilities(capabilities); } -- cgit 1.2.3-korg