Package io.awspring.cloud.s3
Class Jackson2JsonS3ObjectConverter
java.lang.Object
io.awspring.cloud.s3.Jackson2JsonS3ObjectConverter
- All Implemented Interfaces:
S3ObjectConverter
Jackson based implementation of
S3ObjectConverter
. Serializes/deserializes objects to/from JSON.- Since:
- 3.0
- Author:
- Maciej Walkowiak
-
Constructor Summary
ConstructorsConstructorDescriptionJackson2JsonS3ObjectConverter
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionSupported content type.<T> T
read
(InputStream is, Class<T> clazz) Reads S3 object from the input stream into a Java object.<T> software.amazon.awssdk.core.sync.RequestBody
write
(T object) Converts object into aRequestBody
.
-
Constructor Details
-
Jackson2JsonS3ObjectConverter
public Jackson2JsonS3ObjectConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
write
public <T> software.amazon.awssdk.core.sync.RequestBody write(T object) Description copied from interface:S3ObjectConverter
Converts object into aRequestBody
.- Specified by:
write
in interfaceS3ObjectConverter
- Type Parameters:
T
- - type of the object- Parameters:
object
- - the object to serialize- Returns:
- the request body
-
read
Description copied from interface:S3ObjectConverter
Reads S3 object from the input stream into a Java object.- Specified by:
read
in interfaceS3ObjectConverter
- Type Parameters:
T
- - the the type of the object- Parameters:
is
- - the input streamclazz
- - the class of the object- Returns:
- deserialized object
-
contentType
Description copied from interface:S3ObjectConverter
Supported content type.- Specified by:
contentType
in interfaceS3ObjectConverter
- Returns:
- the content type
-