Class JsonSerdes
- java.lang.Object
-
- io.streamthoughts.azkarra.http.json.JsonSerdes
-
public class JsonSerdes extends Object
Helper class for wrappingObjectMapper
.
-
-
Constructor Summary
Constructors Constructor Description JsonSerdes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.fasterxml.jackson.databind.JsonNode
deserialize(byte[] data)
Static helper that can be used to deserialize a given bytes array.static <T> T
deserialize(byte[] data, Class<T> type)
Static helper that can be used to deserialize a given bytes array.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.static com.fasterxml.jackson.databind.JsonNode
deserialize(InputStream is)
Static helper that can be used to deserialize a givenInputStream
.static <T> T
deserialize(InputStream is, Class<T> type)
Static helper that can be used to deserialize a givenInputStream
.static <T> T
deserialize(String data, Class<T> type)
Static helper that can be used to deserialize a givenInputStream
.static String
serialize(Object data)
Static helper that can be used to serialize a given object.
-
-
-
Method Detail
-
deserialize
public static com.fasterxml.jackson.databind.JsonNode deserialize(InputStream is)
Static helper that can be used to deserialize a givenInputStream
.- Parameters:
is
- theInputStream
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 givenInputStream
.- Parameters:
is
- theInputStream
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 givenInputStream
.- 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
.
-
-