From 2a7cd18ca4aaf6d050fe8740bcde53e9a214d224 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Wed, 29 Aug 2018 19:53:08 +0000 Subject: Controller Blueprints Microservice Improve code quality for Performance, JavaDoc, Imports, Probably Bug etc Change-Id: Ib71b62f14e8e8bd212e671a135025258fd9927b4 Issue-ID: CCSDK-491 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- .../dict/validator/ResourceAssignmentValidator.java | 13 ++++++------- .../dict/service/ResourceAssignmentValidationService.kt | 5 +++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'ms/controllerblueprints/modules/resource-dict/src') diff --git a/ms/controllerblueprints/modules/resource-dict/src/main/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/validator/ResourceAssignmentValidator.java b/ms/controllerblueprints/modules/resource-dict/src/main/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/validator/ResourceAssignmentValidator.java index c980a0c0..c9b37c26 100644 --- a/ms/controllerblueprints/modules/resource-dict/src/main/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/validator/ResourceAssignmentValidator.java +++ b/ms/controllerblueprints/modules/resource-dict/src/main/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/validator/ResourceAssignmentValidator.java @@ -29,15 +29,16 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.*; + /** - * * ResourceAssignmentValidator.java Purpose: + * * @author Brinda Santh */ public class ResourceAssignmentValidator { private static final Logger log = LoggerFactory.getLogger(ResourceAssignmentValidator.class); private List assignments; - private Map resourceAssignmentMap = new HashMap(); + private Map resourceAssignmentMap = new HashMap<>(); private StrBuilder validationMessage = new StrBuilder(); public ResourceAssignmentValidator(List assignments) { @@ -72,7 +73,7 @@ public class ResourceAssignmentValidator { * This is a validateResourceAssignment to validate the Topology Template * * @return boolean - * @throws BluePrintException + * @throws BluePrintException BluePrintException */ public boolean validateResourceAssignment() throws BluePrintException { if (assignments != null && !assignments.isEmpty()) { @@ -142,16 +143,14 @@ public class ResourceAssignmentValidator { neighbors.forEach((v, vs) -> { if (v == null) { s.append("\n * -> ["); - List links = vs; - for (ResourceAssignment resourceAssignment : links) { + for (ResourceAssignment resourceAssignment : vs) { s.append("(" + resourceAssignment.getDictionaryName() + ":" + resourceAssignment.getName() + "),"); } s.append("]"); } else { s.append("\n (" + v.getDictionaryName() + ":" + v.getName() + ") -> ["); - List links = vs; - for (ResourceAssignment resourceAssignment : links) { + for (ResourceAssignment resourceAssignment : vs) { s.append("(" + resourceAssignment.getDictionaryName() + ":" + resourceAssignment.getName() + "),"); } diff --git a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt index 6809831f..6a78ac85 100644 --- a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt +++ b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt @@ -16,15 +16,16 @@ package org.onap.ccsdk.apps.controllerblueprints.resource.dict.service +import org.apache.commons.collections.CollectionUtils +import org.apache.commons.lang3.StringUtils import org.apache.commons.lang3.text.StrBuilder import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException import org.onap.ccsdk.apps.controllerblueprints.core.utils.TopologicalSortingUtils import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment import org.onap.ccsdk.apps.controllerblueprints.resource.dict.validator.ResourceAssignmentValidator import org.slf4j.LoggerFactory -import org.apache.commons.collections.CollectionUtils -import org.apache.commons.lang3.StringUtils import java.io.Serializable + /** * ResourceAssignmentValidationService. * -- cgit 1.2.3-korg