public final class CollectionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <E> E[] |
array(E[] existingArray,
E... elements)
Concatenates two arrays
|
static <E> E[] |
arrayOf(Class<E> elementClass,
Object arrayOrElement) |
static <E> E[] |
arrayRemove(E[] array,
E elementToRemove) |
static Object |
arrayRemove(Object array,
Object elementToRemove) |
static <E> List<E> |
concat(boolean removeDuplicates,
Collection<? extends E> firstCollection,
Collection<?>... collections) |
static <E> List<E> |
filter(E[] items,
Predicate<? super E> predicate) |
static <E> List<E> |
filter(Iterable<E> items,
Predicate<? super E> predicate) |
static Object |
find(Map<?,?> map,
String key)
Searches a map for a given key.
|
static <E> void |
forEach(E[] items,
Action<? super E> action) |
static <E> void |
forEach(Iterable<E> items,
Action<? super E> action) |
static boolean |
isNullOrEmpty(Collection<?> col) |
static <E> boolean |
isNullOrEmpty(E[] arr) |
static <I,O> List<O> |
map(I[] items,
Func<? super I,O> func) |
static <I,O> List<O> |
map(Iterable<I> items,
Func<? super I,O> func) |
static List<?> |
toList(Object obj)
General purpose list converter method.
|
public static Object find(Map<?,?> map, String key)
map
- the map to search inkey
- the key to resolvepublic static <E> E[] array(E[] existingArray, E... elements)
existingArray
- an existing arrayelements
- the elements to add to the end of itpublic static <E> List<E> concat(boolean removeDuplicates, Collection<? extends E> firstCollection, Collection<?>... collections)
public static <E> E[] arrayRemove(E[] array, E elementToRemove)
public static <E> void forEach(E[] items, Action<? super E> action)
public static <E> boolean isNullOrEmpty(E[] arr)
public static boolean isNullOrEmpty(Collection<?> col)
public static List<?> toList(Object obj)
obj
- any objectCopyright © 2007–2014 The Apache Software Foundation. All rights reserved.