diff options
author | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-08-29 19:53:08 +0000 |
---|---|---|
committer | Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com> | 2018-08-29 19:53:08 +0000 |
commit | 2a7cd18ca4aaf6d050fe8740bcde53e9a214d224 (patch) | |
tree | 88f9cc1d38b49a385b2ec1b66ac05f7c21327522 /ms/controllerblueprints/modules/resource-dict | |
parent | 382e72538c5df057328b3cf790daaa873849c362 (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')
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 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<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 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. * |