From e0e2aa06217ea5299e720e97f4275197551b3e68 Mon Sep 17 00:00:00 2001 From: "Singal, Kapil (ks220y)" Date: Mon, 23 Sep 2019 18:47:29 -0400 Subject: Refactoring ResourceAssignmentUtils Changing isNull condition to isNullOrEmpty to make sure Empty value doesn't get assigned to resource Issue-ID: CCSDK-1748 Signed-off-by: Singal, Kapil (ks220y) Change-Id: I0744537c7ddec80f20ffd7e6545b947439f63743 --- .../resource/dict/ResourceDefinition.kt | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'ms/controllerblueprints/modules/resource-dict') diff --git a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt index c222de9e5..2966d8b5d 100644 --- a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt +++ b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt @@ -84,15 +84,19 @@ open class ResourceAssignment { var updatedBy: String? = null override fun toString(): String { - return StringBuilder() - .append("[") - .append("name=", name) - .append(", status=", status) - .append(", property=", property?.value ?: "") - .append(", dictionaryName=", dictionaryName) - .append(", dictionarySource=", dictionarySource) - .append("]") - .toString() + return """ + [ + name = $name + status = $status + property [ + defaultValue = ${property?.defaultValue} + required = ${property?.required} + metadata = ${property?.metadata} + ] + dictionaryName = $dictionaryName + dictionarySource = $dictionarySource + ] + """.trimIndent() } } -- cgit 1.2.3-korg