Package org.geotools.data.util
Class CollectionConverterFactory
Object
CollectionConverterFactory
- All Implemented Interfaces:
ConverterFactory
Converts among arrays and different collection classes.
THe following conversions are supported:
- Collection to Collection where collections are different types ( ex list to set )
- Collection to Array
- Array to Collection
- Array to Array where the declared type of the target array is assignable from the declared type of the source array
- Author:
- Justin Deoliveira, The Open Planning Project
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final ConverterConverter for array to array.protected static final ConverterConverter for array to collection.protected static final ConverterConverter for collection to array.protected static final ConverterConverter for collection to collectionFields inherited from interface ConverterFactory
SAFE_CONVERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateConverter(Class<?> source, Class<?> target, Hints hints) Creates aConverterinstance for converting one type of object to another.protected static Collection<Object>newCollection(Class target)
-
Field Details
-
CollectionToCollection
Converter for collection to collection -
CollectionToArray
Converter for collection to array. -
ArrayToCollection
Converter for array to collection. -
ArrayToArray
Converter for array to array.
-
-
Constructor Details
-
CollectionConverterFactory
public CollectionConverterFactory()
-
-
Method Details
-
newCollection
- Throws:
Exception
-
createConverter
Description copied from interface:ConverterFactoryCreates aConverterinstance for converting one type of object to another.- Specified by:
createConverterin interfaceConverterFactory- Parameters:
source- The type to convert from.target- The type to convert to.hints- Hints used to be used while creating a converter.- Returns:
- The converter, or
nullif one could not be found.
-