X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Fconfig%2Fsdc%2FBlueprintParserMappingConfiguration.java;h=20d5d697f3a5481c785f02bc7c3fe8237b2f75ea;hb=7b8d18c2d8893e735e2809609361071bb702b53f;hp=b26310400f945595e891ac4219564048454f691e;hpb=af455560f39b716a8d770a39012e4004ac03e9f3;p=clamp.git diff --git a/src/main/java/org/onap/clamp/clds/config/sdc/BlueprintParserMappingConfiguration.java b/src/main/java/org/onap/clamp/clds/config/sdc/BlueprintParserMappingConfiguration.java index b2631040..20d5d697 100644 --- a/src/main/java/org/onap/clamp/clds/config/sdc/BlueprintParserMappingConfiguration.java +++ b/src/main/java/org/onap/clamp/clds/config/sdc/BlueprintParserMappingConfiguration.java @@ -18,17 +18,18 @@ * limitations under the License. * ============LICENSE_END============================================ * =================================================================== - * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * */ package org.onap.clamp.clds.config.sdc; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; - -import java.io.IOException; +import com.google.gson.reflect.TypeToken; import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; import java.util.List; +import org.onap.clamp.clds.util.JsonUtils; /** * This class is used to decode the configuration found in @@ -38,7 +39,10 @@ import java.util.List; */ public class BlueprintParserMappingConfiguration { + private static final Type BLUEPRINT_MAP_CONF_TYPE = new TypeToken>() { + }.getType(); private String blueprintKey; + private boolean dcaeDeployable; private BlueprintParserFilesConfiguration files; public String getBlueprintKey() { @@ -57,9 +61,11 @@ public class BlueprintParserMappingConfiguration { this.files = filesConfig; } - public static List createFromJson(InputStream json) throws IOException { - TypeReference> mapType = new TypeReference>() { - }; - return new ObjectMapper().readValue(json, mapType); + public boolean isDcaeDeployable() { + return dcaeDeployable; + } + + public static List createFromJson(InputStream json) { + return JsonUtils.GSON.fromJson(new InputStreamReader(json, StandardCharsets.UTF_8), BLUEPRINT_MAP_CONF_TYPE); } }