public class CollectionConverter extends Object implements MatcherConverter, Serializable
Modifier and Type | Field and Description |
---|---|
static CollectionConverter |
INSTANCE
单例实体
|
Constructor and Description |
---|
CollectionConverter() |
Modifier and Type | Method and Description |
---|---|
Collection<?> |
convert(Type targetType,
Object value)
转换为指定类型
如果类型无法确定,将读取默认值的类型做为目标类型 |
Collection<?> |
convert(Type collectionType,
Type elementType,
Object value)
转换
|
boolean |
match(Type targetType,
Class<?> rawType,
Object value)
判断需要转换的对象是否匹配当前转换器,满足则转换,否则跳过
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
match
public static CollectionConverter INSTANCE
public boolean match(Type targetType, Class<?> rawType, Object value)
MatcherConverter
match
in interface MatcherConverter
targetType
- 转换的目标类型,不能为null
rawType
- 目标原始类型,当targetType为Class时,和此参数一致,不能为null
value
- 需要转换的值public Collection<?> convert(Type targetType, Object value)
Converter
public Collection<?> convert(Type collectionType, Type elementType, Object value)
collectionType
- 集合类型elementType
- 集合中元素类型value
- 被转换的值Copyright © 2025. All rights reserved.