Class JsonUtil

java.lang.Object
org.irods.irods4j.common.JsonUtil

public class JsonUtil extends Object
  • Constructor Details

    • JsonUtil

      public JsonUtil()
  • Method Details

    • setJsonMapper

      public static com.fasterxml.jackson.databind.ObjectMapper setJsonMapper(com.fasterxml.jackson.databind.ObjectMapper other)
    • getJsonMapper

      public static com.fasterxml.jackson.databind.ObjectMapper getJsonMapper()
    • enablePrettyPrinting

      public static void enablePrettyPrinting()
    • disablePrettyPrinting

      public static void disablePrettyPrinting()
    • toJsonString

      public static String toJsonString(Object o) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • fromJsonString

      public static <T> T fromJsonString(String data, Class<T> clazz) throws com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.databind.JsonMappingException
      com.fasterxml.jackson.core.JsonProcessingException
    • fromJsonString

      public static <T> T fromJsonString(String data, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) throws com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.databind.JsonMappingException
      com.fasterxml.jackson.core.JsonProcessingException
    • fromBytes

      public static <T> T fromBytes(byte[] data, Class<T> clazz) throws IOException
      Throws:
      IOException
    • fromBytes

      public static <T> T fromBytes(byte[] data, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) throws IOException
      Throws:
      IOException