public class CollectionUtils extends Object
| 构造器和说明 |
|---|
CollectionUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> void |
addAll(Collection<T> collection,
Iterator<T> iterator)
Adds all elements in the iteration to the given collection.
|
static <T> void |
addAll(Collection<T> collection,
T[] elements)
Adds all elements in the array to the given collection.
|
static boolean |
isEmpty(Collection<?> coll)
Null-safe check if the specified collection is empty.
|
static boolean |
isNotEmpty(Collection<?> coll)
Null-safe check if the specified collection is not empty.
|
public static <T> void addAll(Collection<T> collection, Iterator<T> iterator)
collection - the collection to add to, must not be nulliterator - the iterator of elements to add, must not be nullNullPointerException - if the collection or iterator is nullpublic static <T> void addAll(Collection<T> collection, T[] elements)
collection - the collection to add to, must not be nullelements - the array of elements to add, must not be nullNullPointerException - if the collection or array is nullpublic static boolean isEmpty(Collection<?> coll)
Null returns true.
coll - the collection to check, may be nullpublic static boolean isNotEmpty(Collection<?> coll)
Null returns false.
coll - the collection to check, may be nullCopyright © 2015. All rights reserved.