public class Json extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addMixinToObjectMapper(Class<?> targetClass,
Class<?> mixinClass)
Add mixin to object mapper for no-arg constructor classes.
|
static <T> Optional<T> |
deserialize(String body,
Class<T> returnType)
Deserialize the given JSON string to Java object.
|
static <T extends QueryResultData<R>,R extends QueryResult> |
deserializeWithResultSet(okhttp3.Response response,
Class<T> resultSetClass) |
static com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper()
Get the Object Mapper.
|
static String |
serialize(Object object)
Serialize the given Java object into JSON string.
|
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public static String serialize(Object object) throws com.fasterxml.jackson.core.JsonProcessingException
object - Objectcom.fasterxml.jackson.core.JsonProcessingExceptionpublic static void addMixinToObjectMapper(Class<?> targetClass, Class<?> mixinClass) throws com.fasterxml.jackson.core.JsonProcessingException
targetClass - TargetClass.mixinClass - MixinClass.com.fasterxml.jackson.core.JsonProcessingException - JsonProcessingException.public static <T> Optional<T> deserialize(String body, Class<T> returnType)
T - Typebody - The JSON stringreturnType - The type to deserialize intopublic static <T extends QueryResultData<R>,R extends QueryResult> Optional<T> deserializeWithResultSet(okhttp3.Response response, Class<T> resultSetClass)
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries