* 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 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.JacksonUtils;
+import org.onap.clamp.clds.util.JsonUtils;
/**
* This class is used to decode the configuration found in
*/
public class BlueprintParserMappingConfiguration {
+ private static final Type BLUEPRINT_MAP_CONF_TYPE = new TypeToken<List<BlueprintParserMappingConfiguration>>() {
+ }.getType();
private String blueprintKey;
private boolean dcaeDeployable;
private BlueprintParserFilesConfiguration files;
return dcaeDeployable;
}
- public static List<BlueprintParserMappingConfiguration> createFromJson(InputStream json) throws IOException {
- TypeReference<List<BlueprintParserMappingConfiguration>> mapType = new TypeReference<List<BlueprintParserMappingConfiguration>>() {
- };
- return JacksonUtils.getObjectMapperInstance().readValue(json, mapType);
+ public static List<BlueprintParserMappingConfiguration> createFromJson(InputStream json) {
+ return JsonUtils.GSON.fromJson(new InputStreamReader(json, StandardCharsets.UTF_8), BLUEPRINT_MAP_CONF_TYPE);
}
}