Class JsonSerdes


  • public class JsonSerdes
    extends Object
    Helper class for wrapping ObjectMapper.
    • Constructor Detail

      • JsonSerdes

        public JsonSerdes()
    • Method Detail

      • deserialize

        public static com.fasterxml.jackson.databind.JsonNode deserialize​(InputStream is)
        Static helper that can be used to deserialize a given InputStream.
        Parameters:
        is - the InputStream to read.
        Returns:
        the JsonNode.
      • deserialize

        public static <T> T deserialize​(InputStream is,
                                        Class<T> type)
        Static helper that can be used to deserialize a given InputStream.
        Parameters:
        is - the InputStream to read.
        type - the expected type.
        Returns:
        the deserialized object.
      • deserialize

        public static <T> T deserialize​(String data,
                                        Class<T> type)
        Static helper that can be used to deserialize a given InputStream.
        Parameters:
        data - the json string.
        type - the expected type.
        Returns:
        the deserialized object.
      • deserialize

        public static <T> T deserialize​(byte[] data,
                                        Class<T> type)
        Static helper that can be used to deserialize a given bytes array.
        Parameters:
        data - the data to deserialize.
        type - the expected type.
        Returns:
        the deserialized object.
      • deserialize

        public static <T> T deserialize​(com.fasterxml.jackson.databind.JsonNode node,
                                        Class<T> type)
        Static helper that can be used to deserialize a given bytes array.
        Parameters:
        node - the data to deserialize.
        type - the expected type.
        Returns:
        the deserialized object.
      • deserialize

        public static com.fasterxml.jackson.databind.JsonNode deserialize​(byte[] data)
        Static helper that can be used to deserialize a given bytes array.
        Parameters:
        data - the data to deserialize.
        Returns:
        the JsonNode.
      • serialize

        public static String serialize​(Object data)
        Static helper that can be used to serialize a given object.
        Parameters:
        data - the object to serialize
        Returns:
        the JSON string representation.