- java.lang.Object
-
- org.redkale.convert.Convert<R,W>
-
- 类型参数:
R
- Reader输入的子类W
- Writer输出的子类
- 直接已知子类:
BinaryConvert
,TextConvert
public abstract class Convert<R extends Reader,W extends Writer> extends Object
序列化/反序列化操作类详情见: https://redkale.org
- 作者:
- zhangjx
-
-
字段概要
字段 修饰符和类型 字段 说明 protected ConvertFactory<R,W>
factory
static int
FEATURE_NULLABLE
值为true时 字段值为null时会输出,默认为falsestatic int
FEATURE_TINY
值为true时 (String)"",(Boolean)false值不会输出,默认为falseprotected int
features
-
构造器概要
构造器 限定符 构造器 说明 protected
Convert(ConvertFactory<R,W> factory, int features)
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected <S extends W>
SconfigWrite(S writer)
abstract <T> T
convertFrom(Type type, byte[] bytes)
abstract <T> T
convertFrom(Type type, byte[] bytes, int offset, int length)
abstract <T> T
convertFrom(Type type, ByteBuffer... buffers)
abstract <T> T
convertFrom(Type type, R reader)
ByteBuffer[]
convertTo(Supplier<ByteBuffer> supplier, Object value)
abstract ByteBuffer[]
convertTo(Supplier<ByteBuffer> supplier, Type type, Object value)
void
convertTo(W writer, Object value)
abstract void
convertTo(W writer, Type type, Object value)
byte[]
convertToBytes(Object value)
void
convertToBytes(Object value, ConvertBytesHandler handler)
abstract byte[]
convertToBytes(Type type, Object value)
abstract void
convertToBytes(Type type, Object value, ConvertBytesHandler handler)
void
convertToBytes(ByteArray array, Object value)
abstract void
convertToBytes(ByteArray array, Type type, Object value)
protected <S extends W>
SfieldFunc(S writer, BiFunction<Attribute,Object,Object> objFieldFunc, BiFunction mapFieldFunc, Function<Object,ConvertField[]> objExtFunc)
ConvertFactory<R,W>
getFactory()
abstract boolean
isBinary()
Convert<R,W>
newConvert(BiFunction<Attribute,Object,Object> objFieldFunc)
Convert<R,W>
newConvert(BiFunction<Attribute,Object,Object> objFieldFunc, BiFunction mapFieldFunc)
abstract Convert<R,W>
newConvert(BiFunction<Attribute,Object,Object> objFieldFunc, BiFunction mapFieldFunc, Function<Object,ConvertField[]> objExtFunc)
Convert<R,W>
newConvert(BiFunction<Attribute,Object,Object> objFieldFunc, Function<Object,ConvertField[]> objExtFunc)
abstract void
offerReader(R reader)
abstract void
offerWriter(W write)
abstract R
pollReader()
abstract W
pollWriter()
-
-
-
字段详细资料
-
FEATURE_TINY
public static final int FEATURE_TINY
值为true时 (String)"",(Boolean)false值不会输出,默认为false- 另请参阅:
- 常量字段值
-
FEATURE_NULLABLE
public static final int FEATURE_NULLABLE
值为true时 字段值为null时会输出,默认为false- 另请参阅:
- 常量字段值
-
features
protected final int features
-
factory
protected final ConvertFactory<R extends Reader,W extends Writer> factory
-
-
构造器详细资料
-
Convert
protected Convert(ConvertFactory<R,W> factory, int features)
-
-
方法详细资料
-
getFactory
public ConvertFactory<R,W> getFactory()
-
configWrite
protected <S extends W> S configWrite(S writer)
-
fieldFunc
protected <S extends W> S fieldFunc(S writer, BiFunction<Attribute,Object,Object> objFieldFunc, BiFunction mapFieldFunc, Function<Object,ConvertField[]> objExtFunc)
-
newConvert
public Convert<R,W> newConvert(BiFunction<Attribute,Object,Object> objFieldFunc, BiFunction mapFieldFunc)
-
newConvert
public Convert<R,W> newConvert(BiFunction<Attribute,Object,Object> objFieldFunc, Function<Object,ConvertField[]> objExtFunc)
-
newConvert
public abstract Convert<R,W> newConvert(BiFunction<Attribute,Object,Object> objFieldFunc, BiFunction mapFieldFunc, Function<Object,ConvertField[]> objExtFunc)
-
isBinary
public abstract boolean isBinary()
-
pollReader
public abstract R pollReader()
-
offerReader
public abstract void offerReader(R reader)
-
pollWriter
public abstract W pollWriter()
-
offerWriter
public abstract void offerWriter(W write)
-
convertFrom
public abstract <T> T convertFrom(Type type, byte[] bytes)
-
convertFrom
public abstract <T> T convertFrom(Type type, byte[] bytes, int offset, int length)
-
convertFrom
public abstract <T> T convertFrom(Type type, ByteBuffer... buffers)
-
convertToBytes
public final byte[] convertToBytes(Object value)
-
convertToBytes
public final void convertToBytes(Object value, ConvertBytesHandler handler)
-
convertToBytes
public abstract void convertToBytes(Type type, Object value, ConvertBytesHandler handler)
-
convertTo
public final ByteBuffer[] convertTo(Supplier<ByteBuffer> supplier, Object value)
-
convertTo
public abstract ByteBuffer[] convertTo(Supplier<ByteBuffer> supplier, Type type, Object value)
-
-