public class CollectionUtil extends Object
| Constructor and Description |
|---|
CollectionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T> boolean |
addAll(Collection<T> addTo,
Iterable<? extends T> elementsToAdd)
Adds all elements in
iterable to collection. |
static <T> T |
getFirst(Iterable<? extends T> iterable,
T defaultValue)
Returns the first element in
iterable or defaultValue. |
static <T> T |
getLast(Iterator<? extends T> iterator,
T defaultValue)
Return the last element in
iterable or defaultValue. |
static boolean |
intersectIgnoreCase(Collection<String> collection1,
Collection<String> collection2)
Return true if two string collections intersect ignoring the casing of the elements, false otherwise.
|
public static <T> boolean addAll(Collection<T> addTo, Iterable<? extends T> elementsToAdd)
iterable to collection.true if collection was modified as a result of this
operation.public static <T> T getFirst(Iterable<? extends T> iterable, T defaultValue)
iterable or defaultValue.
defaultValue - the default value to return if the iterable is emptyiterable or the default valuepublic static <T> T getLast(Iterator<? extends T> iterator, T defaultValue)
iterable or defaultValue.T - the collection's elements typeiterator - the iterator to iterate ondefaultValue - the default value to return if the iterable is emptyiterable or the default valuepublic static boolean intersectIgnoreCase(Collection<String> collection1, Collection<String> collection2)
collection1 - First collectioncollection2 - Second collectionCopyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries