public class BeanCoder extends Object
For an array or collection object, it will be encoded as List
For Java Beans, it will be converted into Map, the key is of String type (The property name)
For some simple types such as Date, int, it will be converted into a String.
As this encoder won't store any type information, it will only infer the type from the class. For collections fields, the element type information has to be specified with generic type.
| Constructor and Description |
|---|
BeanCoder() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
decode(TDNode obj,
T target) |
static Object |
decode(TDNode obj,
Type type) |
static Object |
decode(TDNode jsonNode,
Type type,
Object targetObj,
String name,
BeanCoderContext ctx) |
static <T> T |
deepClone(T src) |
static <T> T |
deepCopyTo(T src,
T target) |
static TDNode |
encode(Object obj) |
static TDNode |
encode(Object obj,
BeanCoderContext context,
Type type) |
public static final String HASH_KEY
public static TDNode encode(Object obj, BeanCoderContext context, Type type)
public static <T> T decode(TDNode obj, T target)
public static <T> T deepClone(T src)
public static <T> T deepCopyTo(T src,
T target)
public static Object decode(TDNode jsonNode, Type type, Object targetObj, String name, BeanCoderContext ctx)
jsonNode - The json object to decode, the o can be one of following type:type - The target type to decode totargetObj - The target object to decode to, if it's null, a new Object will be createdctx - The decode contextCopyright © 2019. All rights reserved.