Class JsonUtils
java.lang.Object
com.datastax.astra.internal.utils.JsonUtils
Custom implementation of serialization : faster + no jackson dependency
- Author:
- Cedrick Lunven (@clunven)
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
convertValue
(Object bean, Class<T> clazz) Jackson deserialization.static com.fasterxml.jackson.databind.ObjectMapper
Building the data api specific object mapper.static String
Transform object as a String.static <T> T
unMarshallBean
(String body, Class<T> ref) Load body as expected object.
-
Method Details
-
getDataApiObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper getDataApiObjectMapper()Building the data api specific object mapper.- Returns:
- object mapper.
-
marshall
Transform object as a String.- Parameters:
o
- object to be serialized.- Returns:
- body as String
-
convertValue
Jackson deserialization.- Type Parameters:
T
- current type- Parameters:
bean
- current beamclazz
- target class- Returns:
- serialized
-
unMarshallBean
Load body as expected object.- Type Parameters:
T
- parameter- Parameters:
body
- response body as Stringref
- type Reference to map the result- Returns:
- expected objects
-