|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.util.collections.CollectionUtils
public abstract class CollectionUtils
Field Summary | |
---|---|
static Function |
TO_STRING_TRANSFORMER
|
Constructor Summary | |
---|---|
CollectionUtils()
|
Method Summary | |
---|---|
static Filter |
containsFilter(java.util.Collection values)
|
static java.util.List |
filter(java.util.Collection values,
Function filter)
Returns a filtered List of values. |
static java.util.Map |
filterKeys(java.util.Map map,
Function filter)
|
static java.lang.Object |
findFirst(java.util.Collection values,
Function acceptor)
Finds the first value for which acceptor returns true . |
static java.util.List |
flatten(java.util.Collection values)
|
static boolean |
isEmpty(java.util.Collection items)
|
static java.util.List |
toListOfStrings(java.util.Collection values)
|
static java.util.List |
transform(java.util.Collection values,
Function transformer)
Converts a Collection of values of type F to a Serializable List of values of type T. |
static java.util.List |
transform(Function transformer,
java.lang.Object[] values)
Converts a Collection of values of type F to a Serializable List of values of type T. |
static java.util.Map |
transform(java.util.Map map,
Function transformer)
|
static java.util.List |
transformFlat(java.util.Collection values,
Function transformer)
|
static java.util.Map |
transformToMap(java.util.Collection values,
Function transformer)
|
static java.util.Set |
unmodifiableSet(java.util.Collection values)
Returns an immutable Serializable Set containing the values. |
static java.util.Set |
unmodifiableSet(java.lang.Object[] values)
Returns an immutable Serializable Set containing the values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Function TO_STRING_TRANSFORMER
Constructor Detail |
---|
public CollectionUtils()
Method Detail |
---|
public static boolean isEmpty(java.util.Collection items)
public static java.util.List transform(java.util.Collection values, Function transformer)
Collection
of values of type F to a Serializable
List
of values of type T.
Filters out all values converted to null
.
values
- the values to convert.transformer
- Used to convert values.
public static java.util.List transform(Function transformer, java.lang.Object[] values)
Collection
of values of type F to a Serializable
List
of values of type T.
Filters out all values converted to null
.
values
- the values to convert.transformer
- Used to convert values.
public static java.util.List toListOfStrings(java.util.Collection values)
public static java.util.List filter(java.util.Collection values, Function filter)
List
of values. Only values for which filter.apply(T) returns true
are included in the List
or returned values.
values
- the Collection
to be filtered.filter
- the Function
used to filter the Collection
.
List
of values.public static java.util.List flatten(java.util.Collection values)
public static java.util.List transformFlat(java.util.Collection values, Function transformer)
public static java.lang.Object findFirst(java.util.Collection values, Function acceptor)
acceptor
returns true
.
values
- acceptor
-
null
.public static java.util.Set unmodifiableSet(java.lang.Object[] values)
values
-
public static java.util.Set unmodifiableSet(java.util.Collection values)
values
-
public static java.util.Map transformToMap(java.util.Collection values, Function transformer)
entries
- function
-
public static java.util.Map filterKeys(java.util.Map map, Function filter)
public static java.util.Map transform(java.util.Map map, Function transformer)
public static Filter containsFilter(java.util.Collection values)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |