CollectionUtils (Mule ESB 2.2.1 API)
Keywords: org.mule.util.CollectionUtils class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.util
Class CollectionUtils

    java.lang.Object
      org.apache.commons.collections.CollectionUtils
          org.mule.util.CollectionUtils

    public class CollectionUtils

extends CollectionUtils

Field Summary

Fields inherited from class org.apache.commons.collections.CollectionUtils
`EMPTY_COLLECTION`

Constructor Summary
`CollectionUtils()`

Method Summary
`static List` | `addCreate(List list, Object value)` Some code uses null to indicate "unset", which makes appending items complex.
`static List` | `singletonList(Object value)`
`static Object[]` | `toArrayOfComponentType(Collection objects, Class clazz)` Creates an array of the given Collection's elements, but with the given `Class` as element type.
`static String` | `toString(Collection c, boolean newline)` Creates a String representation of the given Collection, with optional newlines between elements.
`static String` | `toString(Collection c, int maxElements)` Calls `toString(Collection, int, boolean)` with `false` for newline.
`static String` | `toString(Collection c, int maxElements, boolean newline)` Creates a String representation of the given Collection, with optional newlines between elements.

Methods inherited from class org.apache.commons.collections.CollectionUtils
`addAll, addAll, addAll, addIgnoreNull, cardinality, collect, collect, collect, collect, containsAny, countMatches, disjunction, exists, filter, find, forAllDo, get, getCardinalityMap, index, index, intersection, isEmpty, isEqualCollection, isFull, isNotEmpty, isProperSubCollection, isSubCollection, maxSize, predicatedCollection, removeAll, retainAll, reverseArray, select, select, selectRejected, selectRejected, size, sizeIsEmpty, subtract, synchronizedCollection, transform, transformedCollection, typedCollection, union, unmodifiableCollection`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CollectionUtils

    public CollectionUtils()

Method Detail

### toArrayOfComponentType

    public static Object[] toArrayOfComponentType(Collection objects,
                                                  Class clazz)

  Creates an array of the given Collection's elements, but with the given `Class` as element type. Useful for arrays of objects that implement multiple interfaces and a "typed view" onto these objects is required.

  Parameters:
    `objects` - a Collection of objects
    `clazz` - the desired service type of the new array
  Returns:
    `null` when objects is `null`, or a new array containing the elements of the source array which is typed to the given `clazz` parameter.
  Throws:
    `IllegalArgumentException` - if the `clazz` argument is `null`.
    `ArrayStoreException` - if the elements in `objects` cannot be cast to `clazz`.

### toString

    public static String toString(Collection c,
                                  boolean newline)

  Creates a String representation of the given Collection, with optional newlines between elements. Class objects are represented by their full names.

  Parameters:
    `c` - the Collection to format
    `newline` - indicates whether elements are to be split across lines
  Returns:
    the formatted String

### toString

    public static String toString(Collection c,
                                  int maxElements)

  Calls `toString(Collection, int, boolean)` with `false` for newline.

### toString

    public static String toString(Collection c,
                                  int maxElements,
                                  boolean newline)

  Creates a String representation of the given Collection, with optional newlines between elements. Class objects are represented by their full names. Considers at most `maxElements` values; overflow is indicated by an appended "[..]" ellipsis.

  Parameters:
    `c` - the Collection to format
    `maxElements` - the maximum number of elements to take into account
    `newline` - indicates whether elements are to be split across lines
  Returns:
    the formatted String

### addCreate

    public static List addCreate(List list,
                                 Object value)

  Some code uses null to indicate "unset", which makes appending items complex.

### singletonList

    public static List singletonList(Object value)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.