public class CollectionConverter extends Object implements Converter<Collection<?>>
Constructor and Description |
---|
CollectionConverter()
构造,默认集合类型使用
Collection |
CollectionConverter(Class<?> collectionType)
构造
|
CollectionConverter(Type collectionType)
构造
|
CollectionConverter(Type collectionType,
Type elementType)
构造
|
Modifier and Type | Method and Description |
---|---|
Collection<?> |
convert(Object value,
Collection<?> defaultValue)
转换为指定类型
如果类型无法确定,将读取默认值的类型做为目标类型 |
protected Collection<?> |
convertInternal(Object value)
内部转换
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertWithCheck
public CollectionConverter()
Collection
public CollectionConverter(Type collectionType)
collectionType
- 集合类型public CollectionConverter(Class<?> collectionType)
collectionType
- 集合类型public Collection<?> convert(Object value, Collection<?> defaultValue) throws IllegalArgumentException
Converter
convert
in interface Converter<Collection<?>>
value
- 原始值defaultValue
- 默认值IllegalArgumentException
- 无法确定目标类型,且默认值为null
,无法确定类型protected Collection<?> convertInternal(Object value)
value
- 值Copyright © 2024. All rights reserved.