Modifier and Type | Field and Description |
---|---|
static PairConverter |
INSTANCE
单例
|
Constructor and Description |
---|
PairConverter() |
Modifier and Type | Method and Description |
---|---|
Object |
convert(Type targetType,
Object value)
转换为指定类型
如果类型无法确定,将读取默认值的类型做为目标类型 |
Pair<?,?> |
convert(Type leftType,
Type rightType,
Object value)
转换对象为指定键值类型的指定类型Map
|
public static final PairConverter INSTANCE
public Object convert(Type targetType, Object value) throws ConvertException
Converter
convert
in interface Converter
targetType
- 目标Type,非泛型类使用value
- 原始值,如果对象实现了此接口,则value为thisConvertException
- 转换无法正常完成或转换异常时抛出此异常public Pair<?,?> convert(Type leftType, Type rightType, Object value) throws ConvertException
leftType
- 键类型rightType
- 值类型value
- 被转换的值ConvertException
- 转换异常或不支持的类型Copyright © 2024. All rights reserved.