org.apache.commons.convert
Class CollectionConverters.ArrayToList<T>
java.lang.Object
org.apache.commons.convert.AbstractConverter<T[],List<T>>
org.apache.commons.convert.CollectionConverters.ArrayToList<T>
- All Implemented Interfaces:
- Converter<T[],List<T>>, ConverterLoader
- Enclosing class:
- CollectionConverters
public static class CollectionConverters.ArrayToList<T>
- extends AbstractConverter<T[],List<T>>
An object that converts an array to a List
.
Method Summary |
boolean |
canConvert(Class<?> sourceClass,
Class<?> targetClass)
Returns true if this object can convert
sourceClass to targetClass . |
List<T> |
convert(T[] obj)
Returns a List that contains the elements in
obj . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionConverters.ArrayToList
public CollectionConverters.ArrayToList()
canConvert
public boolean canConvert(Class<?> sourceClass,
Class<?> targetClass)
- Description copied from interface:
Converter
- Returns
true
if this object can convert
sourceClass
to targetClass
.
Implementations can accomodate class hierarchy ranges
by converting super classes or interfaces.
- Specified by:
canConvert
in interface Converter<T[],List<T>>
- Overrides:
canConvert
in class AbstractConverter<T[],List<T>>
- Parameters:
sourceClass
- The source Class
targetClass
- The target Class
- Returns:
true
if this object can convert
sourceClass
to targetClass
.
convert
public List<T> convert(T[] obj)
throws ConversionException
- Returns a
List
that contains the elements in
obj
.
- Parameters:
obj
- The source Object
to convert
- Returns:
- The converted
Object
- Throws:
ConversionException
Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.