public abstract class CollectionUtils extends Object
Constructor and Description |
---|
CollectionUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> Collection<T> |
cloneCollection(Collection<T> collection) |
static <T> List<T> |
cloneList(List<T> list) |
static <K,V> Map<K,V> |
cloneMap(Map<K,V> map) |
static <T> boolean |
equals(Collection<T> c1,
Collection<T> c2) |
static <T> T |
first(Collection<T> collection) |
static boolean |
isEmpty(Collection<?> collection)
Return
true if the supplied Collection is null or empty. |
static <T> List<T> |
toList(T... items)
Converts the supplied array into a List.
|
static <T> Set<T> |
toSet(T... items)
Converts the supplied array into a Set.
|
static <T> List<T> |
toUnmodifiableList(T... items) |
static <T> Set<T> |
toUnmodifiableSet(T... items) |
public static boolean isEmpty(Collection<?> collection)
true
if the supplied Collection
is null or empty. Otherwise,
return false
.collection
- the Collection
to checkpublic static <T> List<T> toList(T... items)
source
- the original arraypublic static <T> List<T> toUnmodifiableList(T... items)
public static <T> Set<T> toSet(T... items)
source
- the original arraypublic static <T> Set<T> toUnmodifiableSet(T... items)
public static <T> boolean equals(Collection<T> c1, Collection<T> c2)
public static <T> Collection<T> cloneCollection(Collection<T> collection)
public static <T> T first(Collection<T> collection)
Copyright © GigaSpaces.