public final class CodecJSON extends Object implements Codec
Configs or CodecJackson.| Modifier and Type | Method and Description |
|---|---|
<T> T |
decode(Class<T> type,
byte[] data) |
<T> T |
decode(T shell,
byte[] data) |
static <T> T |
decodeJSON(T object,
com.fasterxml.jackson.databind.JsonNode json) |
static <T> T |
decodeString(Class<T> type,
String json) |
static <T> T |
decodeString(T object,
String json)
Deprecated.
Use
decodeString(Class, String) instead. |
byte[] |
encode(Object obj) |
static com.addthis.maljson.JSONObject |
encodeJSON(Object object)
Deprecated.
|
static com.fasterxml.jackson.databind.JsonNode |
encodeJsonNode(Object object) |
static String |
encodeString(Object object) |
boolean |
storesNull(byte[] data) |
static String |
tryEncodeString(Object object,
String defaultValue) |
public static final CodecJSON INSTANCE
public <T> T decode(T shell,
byte[] data)
throws IOException
decode in interface CodecIOExceptionpublic boolean storesNull(byte[] data)
storesNull in interface Codecpublic static com.fasterxml.jackson.databind.JsonNode encodeJsonNode(Object object) throws Exception
Exception@Deprecated public static com.addthis.maljson.JSONObject encodeJSON(Object object) throws Exception
Exceptionpublic static String encodeString(Object object) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException@Deprecated public static <T> T decodeString(T object, String json) throws IOException
decodeString(Class, String) instead.IOExceptionpublic static <T> T decodeString(Class<T> type, String json) throws IOException
IOExceptionpublic static <T> T decodeJSON(T object,
com.fasterxml.jackson.databind.JsonNode json)
throws IOException
IOExceptionCopyright © 2015 AddThis. All rights reserved.