Class Jackson
java.lang.Object
org.apache.pekko.http.javadsl.marshallers.jackson.Jackson
A JSON marshaller/unmarshaller using the Jackson library.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Unmarshaller<org.apache.pekko.util.ByteString,T> byteStringUnmarshaller(com.fasterxml.jackson.databind.ObjectMapper mapper, Class<T> expectedType) Returns an unmarshaller that converts a JSONByteStringto a value of the given type using the givenObjectMapper.static <T> Unmarshaller<org.apache.pekko.util.ByteString,T> byteStringUnmarshaller(Class<T> expectedType) Returns an unmarshaller that converts a JSONByteStringto a value of the given type using the defaultObjectMapper.static <T> Marshaller<T,RequestEntity> Returns a marshaller that converts a value of typeTto a JSONRequestEntityusing the defaultObjectMapper.static <T> Marshaller<T,RequestEntity> marshaller(com.fasterxml.jackson.databind.ObjectMapper mapper) Returns a marshaller that converts a value of typeTto a JSONRequestEntityusing the givenObjectMapper.static <T> Unmarshaller<HttpEntity,T> unmarshaller(com.fasterxml.jackson.databind.ObjectMapper mapper, Class<T> expectedType) Returns an unmarshaller that converts a JSONHttpEntityto a value of the given type using the givenObjectMapper.static <T> Unmarshaller<HttpEntity,T> unmarshaller(Class<T> expectedType) Returns an unmarshaller that converts a JSONHttpEntityto a value of the given type using the defaultObjectMapper.
-
Constructor Details
-
Jackson
public Jackson()
-
-
Method Details
-
marshaller
Returns a marshaller that converts a value of typeTto a JSONRequestEntityusing the defaultObjectMapper.- Type Parameters:
T- the type of the value to marshal
-
marshaller
public static <T> Marshaller<T,RequestEntity> marshaller(com.fasterxml.jackson.databind.ObjectMapper mapper) Returns a marshaller that converts a value of typeTto a JSONRequestEntityusing the givenObjectMapper.- Type Parameters:
T- the type of the value to marshal- Parameters:
mapper- the ObjectMapper to use for serialization
-
byteStringUnmarshaller
public static <T> Unmarshaller<org.apache.pekko.util.ByteString,T> byteStringUnmarshaller(Class<T> expectedType) Returns an unmarshaller that converts a JSONByteStringto a value of the given type using the defaultObjectMapper.- Type Parameters:
T- the target type- Parameters:
expectedType- the class of the target type
-
unmarshaller
Returns an unmarshaller that converts a JSONHttpEntityto a value of the given type using the defaultObjectMapper.- Type Parameters:
T- the target type- Parameters:
expectedType- the class of the target type
-
unmarshaller
public static <T> Unmarshaller<HttpEntity,T> unmarshaller(com.fasterxml.jackson.databind.ObjectMapper mapper, Class<T> expectedType) Returns an unmarshaller that converts a JSONHttpEntityto a value of the given type using the givenObjectMapper.- Type Parameters:
T- the target type- Parameters:
mapper- the ObjectMapper to use for deserializationexpectedType- the class of the target type
-
byteStringUnmarshaller
public static <T> Unmarshaller<org.apache.pekko.util.ByteString,T> byteStringUnmarshaller(com.fasterxml.jackson.databind.ObjectMapper mapper, Class<T> expectedType) Returns an unmarshaller that converts a JSONByteStringto a value of the given type using the givenObjectMapper.- Type Parameters:
T- the target type- Parameters:
mapper- the ObjectMapper to use for deserializationexpectedType- the class of the target type
-