summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt11
1 files changed, 5 insertions, 6 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt
index 7c2466fb7..73dff9379 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt
@@ -236,27 +236,27 @@ class JacksonUtils {
}
}
- fun populatePrimitiveValues(key: String, value: Any, primitiveType: String, objectNode: ObjectNode) {
+ fun populatePrimitiveValues(key: String, value: JsonNode, primitiveType: String, objectNode: ObjectNode) {
when (primitiveType.toLowerCase()) {
BluePrintConstants.DATA_TYPE_BOOLEAN,
BluePrintConstants.DATA_TYPE_INTEGER,
BluePrintConstants.DATA_TYPE_FLOAT,
BluePrintConstants.DATA_TYPE_DOUBLE,
BluePrintConstants.DATA_TYPE_TIMESTAMP,
- BluePrintConstants.DATA_TYPE_STRING->
- objectNode.set(key, value.asJsonPrimitive())
+ BluePrintConstants.DATA_TYPE_STRING ->
+ objectNode.set(key, value)
else -> throw BluePrintException("populatePrimitiveValues expected only primitive values! Received: ($value)")
}
}
- fun populatePrimitiveValues(value: Any, primitiveType: String, arrayNode: ArrayNode) {
+ fun populatePrimitiveValues(value: JsonNode, primitiveType: String, arrayNode: ArrayNode) {
when (primitiveType.toLowerCase()) {
BluePrintConstants.DATA_TYPE_BOOLEAN,
BluePrintConstants.DATA_TYPE_INTEGER,
BluePrintConstants.DATA_TYPE_FLOAT,
BluePrintConstants.DATA_TYPE_DOUBLE,
BluePrintConstants.DATA_TYPE_TIMESTAMP,
- BluePrintConstants.DATA_TYPE_STRING -> arrayNode.add(value.asJsonPrimitive())
+ BluePrintConstants.DATA_TYPE_STRING -> arrayNode.add(value)
else -> throw BluePrintException("populatePrimitiveValues expected only primitive values! Received: ($value)")
}
}
@@ -300,7 +300,6 @@ class JacksonUtils {
BluePrintConstants.DATA_TYPE_INTEGER -> jsonNodeFromObject(value.toInt())
BluePrintConstants.DATA_TYPE_FLOAT -> jsonNodeFromObject(value.toFloat())
BluePrintConstants.DATA_TYPE_DOUBLE -> jsonNodeFromObject(value.toDouble())
- //TODO: Verify.. I assume string type should be here..
BluePrintConstants.DATA_TYPE_STRING -> jsonNodeFromObject(value)
else -> getJsonNode(value)
}