- java.lang.Object
-
- org.redkale.util.OneOrList<T>
-
- 类型参数:
T
- 泛型
- 所有已实现的接口:
Serializable
public class OneOrList<T> extends Object implements Serializable
单个对象或对象数组的合并类详情见: https://redkale.org
- 从以下版本开始:
- 2.7.0
- 作者:
- zhangjx
- 另请参阅:
- 序列化表格
-
-
字段概要
字段 修饰符和类型 字段 说明 protected List<T>
list
protected T
one
static Type
TYPE_OL_BIGDECIMAL
static Type
TYPE_OL_BIGINTEGER
static Type
TYPE_OL_DOUBLE
static Type
TYPE_OL_FLOAT
static Type
TYPE_OL_INTEGER
static Type
TYPE_OL_LONG
static Type
TYPE_OL_STRING
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 protected static Decodeable<JsonReader,OneOrList>
createDecoder(JsonFactory factory, Type type)
protected static Encodeable<JsonWriter,OneOrList>
createEncoder(JsonFactory factory, Type type)
List<T>
getList()
T
getOne()
boolean
isTypeOne()
protected static Type
parseItemType(Type type)
void
setList(List<T> list)
void
setOne(T one)
String
toString()
-
-
-
字段详细资料
-
TYPE_OL_STRING
public static final Type TYPE_OL_STRING
-
TYPE_OL_INTEGER
public static final Type TYPE_OL_INTEGER
-
TYPE_OL_LONG
public static final Type TYPE_OL_LONG
-
TYPE_OL_FLOAT
public static final Type TYPE_OL_FLOAT
-
TYPE_OL_DOUBLE
public static final Type TYPE_OL_DOUBLE
-
TYPE_OL_BIGINTEGER
public static final Type TYPE_OL_BIGINTEGER
-
TYPE_OL_BIGDECIMAL
public static final Type TYPE_OL_BIGDECIMAL
-
one
@ConvertColumn(index=1) protected T one
-
list
@ConvertColumn(index=2) protected List<T> list
-
-
方法详细资料
-
createEncoder
protected static Encodeable<JsonWriter,OneOrList> createEncoder(JsonFactory factory, Type type)
-
createDecoder
protected static Decodeable<JsonReader,OneOrList> createDecoder(JsonFactory factory, Type type)
-
isTypeOne
public boolean isTypeOne()
-
getOne
public T getOne()
-
setOne
public void setOne(T one)
-
-