org.apache.camel.util
Class CollectionHelper

java.lang.Object
  extended by org.apache.camel.util.CollectionHelper

public final class CollectionHelper
extends Object

A number of helper methods for working with collections

Version:

Method Summary
static void appendValue(Map<String,Object> map, String key, Object value)
          Sets the value of the entry in the map for the given key, though if the map already contains a value for the given key then the value is appended to a list of values.
static String collectionAsCommaDelimitedString(Collection<?> col)
           
static String collectionAsCommaDelimitedString(String[] col)
           
static
<T> Set<T>
createSetContaining(T... contents)
           
static Integer size(Object value)
          Returns the size of the collection if it can be determined to be a collection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

size

public static Integer size(Object value)
Returns the size of the collection if it can be determined to be a collection

Parameters:
value - the collection
Returns:
the size, or null if not a collection

appendValue

public static void appendValue(Map<String,Object> map,
                               String key,
                               Object value)
Sets the value of the entry in the map for the given key, though if the map already contains a value for the given key then the value is appended to a list of values.

Parameters:
map - the map to add the entry to
key - the key in the map
value - the value to put in the map

createSetContaining

public static <T> Set<T> createSetContaining(T... contents)

collectionAsCommaDelimitedString

public static String collectionAsCommaDelimitedString(String[] col)

collectionAsCommaDelimitedString

public static String collectionAsCommaDelimitedString(Collection<?> col)


Apache CAMEL