Package com.oracle.cloud.spring.storage
Class JacksonJSONStorageObjectConverter
java.lang.Object
com.oracle.cloud.spring.storage.JacksonJSONStorageObjectConverter
- All Implemented Interfaces:
StorageObjectConverter
Default implementation of
StorageObjectConverter
-
Constructor Summary
ConstructorsConstructorDescriptionJacksonJSONStorageObjectConverter
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionReturns JSON content type.<T> T
read
(InputStream is, Class<T> clazz) Create Java POJO of the specific class type from the input stream<T> byte[]
write
(T object) Generates byte[] for the specific object
-
Constructor Details
-
JacksonJSONStorageObjectConverter
public JacksonJSONStorageObjectConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
write
public <T> byte[] write(T object) Generates byte[] for the specific object- Specified by:
write
in interfaceStorageObjectConverter
- Type Parameters:
T
- Type of Java POJO- Parameters:
object
- Java POJO- Returns:
- byte[]
-
read
Create Java POJO of the specific class type from the input stream- Specified by:
read
in interfaceStorageObjectConverter
- Type Parameters:
T
- Type of the Java POJO- Parameters:
is
- InputStream to read data from.clazz
- Class instance of the type of Java POJO- Returns:
- Instance of Java POJO
-
contentType
Returns JSON content type.- Specified by:
contentType
in interfaceStorageObjectConverter
- Returns:
- "application/json"
-