org.apache.camel.converter
Class CollectionConverter

java.lang.Object
  extended by org.apache.camel.converter.CollectionConverter

@Converter
public final class CollectionConverter
extends Object

Some core java.util Collection based Type Converters

Version:

Method Summary
static Object[] toArray(Collection<?> value)
          Converts a collection to an array
static
<T> ArrayList<T>
toArrayList(Iterator<T> it)
          Converts an Iterator to a ArrayList
static
<K,V> HashMap<K,V>
toHashMap(Map<? extends K,? extends V> map)
           
static
<K,V> Hashtable<K,V>
toHashtable(Map<? extends K,? extends V> map)
           
static
<T> List<T>
toList(Collection<T> collection)
          Converts a collection to a List if it is not already
static
<T> List<T>
toList(Iterable<T> iterable)
          Converts an Iterable into a List
static List<Object> toList(Object[] array)
          Converts an array to a collection
static Properties toProperties(Map<Object,Object> map)
           
static
<T> Set<T>
toSet(Collection<T> collection)
           
static
<K,V> Set<Map.Entry<K,V>>
toSet(Map<K,V> map)
           
static Set<Object> toSet(Object[] array)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toArray

@Converter
public static Object[] toArray(Collection<?> value)
Converts a collection to an array


toList

@Converter
public static List<Object> toList(Object[] array)
Converts an array to a collection


toList

@Converter
public static <T> List<T> toList(Collection<T> collection)
Converts a collection to a List if it is not already


toArrayList

@Converter
public static <T> ArrayList<T> toArrayList(Iterator<T> it)
Converts an Iterator to a ArrayList


toSet

@Converter
public static Set<Object> toSet(Object[] array)

toSet

@Converter
public static <T> Set<T> toSet(Collection<T> collection)

toSet

@Converter
public static <K,V> Set<Map.Entry<K,V>> toSet(Map<K,V> map)

toProperties

@Converter
public static Properties toProperties(Map<Object,Object> map)

toHashtable

@Converter
public static <K,V> Hashtable<K,V> toHashtable(Map<? extends K,? extends V> map)

toHashMap

@Converter
public static <K,V> HashMap<K,V> toHashMap(Map<? extends K,? extends V> map)

toList

@Converter
public static <T> List<T> toList(Iterable<T> iterable)
Converts an Iterable into a List



Apache CAMEL