public abstract class CollectionUtils extends CollectionUtils
Collection,
Collections,
CollectionUtils| Constructor and Description |
|---|
CollectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Collection<T> |
nullSafeCollection(Collection<T> collection)
A null-safe operation returning the original Collection if non-null or an empty Collection
(implemented with List) if null.
|
static <T> Iterable<T> |
nullSafeIterable(Iterable<T> iterable)
A null-safe operation returning the original Iterable object if non-null or a default, empty Iterable
implementation if null.
|
arrayToList, contains, contains, containsAny, containsInstance, findCommonElementType, findFirstMatch, findValueOfType, findValueOfType, hasUniqueObject, isEmpty, isEmpty, mergeArrayIntoCollection, mergePropertiesIntoMap, toArray, toIterator, toMultiValueMap, unmodifiableMultiValueMappublic static <T> Iterable<T> nullSafeIterable(Iterable<T> iterable)
public static <T> Collection<T> nullSafeCollection(Collection<T> collection)
T - the element class type of the Collection.collection - the Collection to evaluate for being null.Collections.emptyList()