1 package org.onap.nbi.apis.serviceorder.utils;
3 import java.io.IOException;
4 import org.onap.nbi.apis.serviceorder.model.orchestrator.ServiceOrderInfo;
5 import com.fasterxml.jackson.databind.ObjectMapper;
7 public final class JsonEntityConverter {
9 private static final ObjectMapper MAPPER = new ObjectMapper();
11 public static String convertServiceOrderInfoToJson(ServiceOrderInfo serviceOrderInfo) {
12 return MAPPER.valueToTree(serviceOrderInfo).toString();
15 public static ServiceOrderInfo convertJsonToServiceOrderInfo(String serviceOrderInfoJson) throws IOException {
16 return MAPPER.treeToValue(MAPPER.readTree(serviceOrderInfoJson), ServiceOrderInfo.class);