1 package org.openkilda.utility;
3 import com.fasterxml.jackson.core.JsonParseException;
4 import com.fasterxml.jackson.core.JsonProcessingException;
5 import com.fasterxml.jackson.databind.JsonMappingException;
6 import com.fasterxml.jackson.databind.ObjectMapper;
8 import java.io.IOException;
12 private static ObjectMapper mapper =
new ObjectMapper();
25 public static String
toString(
final Object obj)
throws JsonProcessingException {
26 return mapper.writeValueAsString(obj);
29 public static <T> T
toObject(
final String
data,
final Class<T> objClass)
throws JsonParseException, JsonMappingException, IOException {
30 return mapper.readValue(
data, objClass);
static< T > T toObject(final String data, final Class< T > objClass)
static String toString(final Object obj)