|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.CollectionUtils org.mule.util.CollectionUtils
public class 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 boolean |
containsType(Collection<?> collection,
Class<?> type)
|
|
static void |
removeType(Collection<?> collection,
Class<?> type)
|
|
static List |
singletonList(Object value)
|
|
static
|
toArrayOfComponentType(Collection objects,
Class<T> 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 |
---|
public CollectionUtils()
Method Detail |
---|
public static <T> T[] toArrayOfComponentType(Collection objects, Class<T> clazz)
Class
as element type. Useful for arrays of objects that
implement multiple interfaces and a "typed view" onto these objects is
required.
objects
- a Collection of objectsclazz
- the desired service type of the new array
null
when objects is null
, or a new
array containing the elements of the source array which is typed to
the given clazz
parameter.
IllegalArgumentException
- if the clazz
argument is
null
.
ArrayStoreException
- if the elements in objects
cannot
be cast to clazz
.public static String toString(Collection c, boolean newline)
c
- the Collection to formatnewline
- indicates whether elements are to be split across lines
public static String toString(Collection c, int maxElements)
toString(Collection, int, boolean)
with false
for newline.
public static String toString(Collection c, int maxElements, boolean newline)
maxElements
values; overflow is indicated by
an appended "[..]" ellipsis.
c
- the Collection to formatmaxElements
- the maximum number of elements to take into accountnewline
- indicates whether elements are to be split across lines
public static List addCreate(List list, Object value)
public static List singletonList(Object value)
public static boolean containsType(Collection<?> collection, Class<?> type)
public static void removeType(Collection<?> collection, Class<?> type)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |