diff options
author | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2021-07-26 12:00:59 -0400 |
---|---|---|
committer | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2021-07-28 09:06:26 -0400 |
commit | 45263f50896a7021cd17d78ce83b29365cb19c29 (patch) | |
tree | 0245881b0c3badd2e72144dc29311f4e7df58e38 /ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt | |
parent | 76cb04c2302c9f8f0395f86d8e8d246fdae0fd28 (diff) |
Revert "Renaming Files having BluePrint to have Blueprint"1.1.5
The renaming in CCSDK-3098 caused breaking changes to the grpc api and
compile issues for kotlin scripts.
Issue-ID: CCSDK-3385
Change-Id: I0d745cb858371678eabcb2284671c1fd76a1ab6d
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Diffstat (limited to 'ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt')
-rw-r--r-- | ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt index 25abcd30b..ebe682611 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt @@ -113,7 +113,7 @@ fun <T : Any?> T.asJsonPrimitive(): JsonNode { is Double -> this.asJsonPrimitive() else -> - throw BlueprintException("$this type is not supported") + throw BluePrintException("$this type is not supported") } } } @@ -121,11 +121,11 @@ fun <T : Any?> T.asJsonPrimitive(): JsonNode { /** Based on Blueprint DataType Convert string value to JsonNode Type **/ fun String.asJsonType(bpDataType: String): JsonNode { return when (bpDataType.toLowerCase()) { - BlueprintConstants.DATA_TYPE_STRING -> this.asJsonPrimitive() - BlueprintConstants.DATA_TYPE_BOOLEAN -> this.toBoolean().asJsonPrimitive() - BlueprintConstants.DATA_TYPE_INTEGER -> this.toInt().asJsonPrimitive() - BlueprintConstants.DATA_TYPE_FLOAT -> this.toFloat().asJsonPrimitive() - BlueprintConstants.DATA_TYPE_DOUBLE -> this.toDouble().asJsonPrimitive() + BluePrintConstants.DATA_TYPE_STRING -> this.asJsonPrimitive() + BluePrintConstants.DATA_TYPE_BOOLEAN -> this.toBoolean().asJsonPrimitive() + BluePrintConstants.DATA_TYPE_INTEGER -> this.toInt().asJsonPrimitive() + BluePrintConstants.DATA_TYPE_FLOAT -> this.toFloat().asJsonPrimitive() + BluePrintConstants.DATA_TYPE_DOUBLE -> this.toDouble().asJsonPrimitive() // For List, Map and Complex Types. else -> this.jsonAsJsonType() } @@ -182,7 +182,7 @@ fun <T : Any> Map<String, *>.castValue(key: String, valueType: KClass<T>): T { if (containsKey(key)) { return get(key) as T } else { - throw BlueprintException("couldn't find the key $key") + throw BluePrintException("couldn't find the key $key") } } @@ -197,7 +197,7 @@ fun JsonNode.asByteArray(): ByteArray { fun <T> JsonNode.asType(clazzType: Class<T>): T { return JacksonUtils.readValue(this, clazzType) - ?: throw BlueprintException("couldn't convert JsonNode of type $clazzType") + ?: throw BluePrintException("couldn't convert JsonNode of type $clazzType") } fun JsonNode.asListOfString(): List<String> { @@ -226,7 +226,7 @@ fun JsonNode.rootFieldsToMap(): MutableMap<String, JsonNode> { } return propertyMap } else { - throw BlueprintException("json node should be Object Node Type") + throw BluePrintException("json node should be Object Node Type") } } @@ -248,19 +248,19 @@ fun MutableMap<String, JsonNode>.putJsonElement(key: String, value: Any) { } fun Map<String, JsonNode>.getAsString(key: String): String { - return this[key]?.asText() ?: throw BlueprintException("couldn't find value for key($key)") + return this[key]?.asText() ?: throw BluePrintException("couldn't find value for key($key)") } fun Map<String, JsonNode>.getAsBoolean(key: String): Boolean { - return this[key]?.asBoolean() ?: throw BlueprintException("couldn't find value for key($key)") + return this[key]?.asBoolean() ?: throw BluePrintException("couldn't find value for key($key)") } fun Map<String, JsonNode>.getAsInt(key: String): Int { - return this[key]?.asInt() ?: throw BlueprintException("couldn't find value for key($key)") + return this[key]?.asInt() ?: throw BluePrintException("couldn't find value for key($key)") } fun Map<String, JsonNode>.getAsDouble(key: String): Double { - return this[key]?.asDouble() ?: throw BlueprintException("couldn't find value for key($key)") + return this[key]?.asDouble() ?: throw BluePrintException("couldn't find value for key($key)") } fun Map<String, JsonNode>.getOptionalAsString(key: String): String? { @@ -285,7 +285,7 @@ inline fun checkEquals(value1: String?, value2: String?, lazyMessage: () -> Any) if (value1.equals(value2, ignoreCase = true)) { return true } else { - throw BlueprintException(lazyMessage().toString()) + throw BluePrintException(lazyMessage().toString()) } } |