From: Muthuramalingam, Brinda Santh(bs2796) Date: Wed, 5 Sep 2018 17:42:22 +0000 (+0000) Subject: Controller Blueprints Microservice X-Git-Tag: 0.4.2~163^2~129 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=e2ed7eb15fdda46c51f08eeb688fcc75ef45098b;p=ccsdk%2Fcds.git Controller Blueprints Microservice Modify Model Type and Resource Defintions persistance and access from String to JSON type for easy handling. Change-Id: Icfe7e95abad715b0ccad16c681ed057d289a6229 Issue-ID: CCSDK-431 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt index 5075e7261..cf5f9e20c 100644 --- a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt +++ b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonUtils.kt @@ -49,6 +49,11 @@ object JacksonUtils { return jacksonObjectMapper().readValue(content, valueType) } + @JvmStatic + fun readValue(node: JsonNode, valueType: Class): T? { + return jacksonObjectMapper().treeToValue(node, valueType) + } + @JvmStatic fun getContent(fileName: String): String { return File(fileName).readText(Charsets.UTF_8)