summaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/resource-dict/src
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-29 19:53:08 +0000
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-29 19:53:08 +0000
commit254217ffff5edea9069f96b992a5939b3745d376 (patch)
treeb05449e70eb89114768fd6b6c10a7e068bda159b /ms/controllerblueprints/modules/resource-dict/src
parente10032c90bfcf5c56fc3200e89b142b782eac88f (diff)
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) <bs2796@att.com>
Diffstat (limited to 'ms/controllerblueprints/modules/resource-dict/src')
-rw-r--r--ms/controllerblueprints/modules/resource-dict/src/main/java/org/onap/ccsdk/apps/controllerblueprints/resource/dict/validator/ResourceAssignmentValidator.java13
-rw-r--r--ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/resource/dict/service/ResourceAssignmentValidationService.kt5
2 files changed, 9 insertions, 9 deletions
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 c980a0c08..c9b37c269 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<ResourceAssignment> assignments;
- private Map<String, ResourceAssignment> resourceAssignmentMap = new HashMap();
+ private Map<String, ResourceAssignment> resourceAssignmentMap = new HashMap<>();
private StrBuilder validationMessage = new StrBuilder();
public ResourceAssignmentValidator(List<ResourceAssignment> 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<ResourceAssignment> 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<ResourceAssignment> 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 6809831f9..6a78ac852 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.
*