public final class CollectionExtensions extends Object
CollectionExtensions is an extension class for use with Collection
objects.| Constructor and Description |
|---|
CollectionExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
difference(Collection<T> collection1,
Collection<T> collection2)
Difference.
|
static <T> Collection<T> |
intersection(Collection<T>... toIntersect)
Intersection of the given collections.
|
static <T> boolean |
isEmpty(Collection<T> collection)
Checks if the given
Collection is null or empty. |
static <T> boolean |
isNotEmpty(Collection<T> collection)
Checks if the given
Collection is not null or empty |
public static <T> void difference(Collection<T> collection1, Collection<T> collection2)
T - the generic typecollection1 - the collection 1collection2 - the collection 2@SafeVarargs public static <T> Collection<T> intersection(Collection<T>... toIntersect)
Collection.retainAll(Collection) for come to the result.T - the generic typetoIntersect - the to intersectpublic static <T> boolean isNotEmpty(Collection<T> collection)
Collection is not null or emptyT - the generic typecollection - The collection to checkCollection is null or empty otherwise falsepublic static <T> boolean isEmpty(Collection<T> collection)
Collection is null or empty.T - the generic typecollection - The collection to checkCollection is null or empty otherwise false.Copyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.