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> one,
Collection<T> other)
Removes all of the first given collection's elements that are also contained in the second
given collection.
|
static <T> int |
hashCode(Collection<T[]> arrayObjects)
Returns a hash code based on the contents of the collection that contains array objects.
|
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 |
isEqualCollection(Collection<T> one,
Collection<T> other)
Compare the given two
Collection objects in equality. |
static <T> boolean |
isNotEmpty(Collection<T> collection)
Checks if the given
Collection is not null or empty |
public static <T> boolean isEqualCollection(Collection<T> one, Collection<T> other)
Collection objects in equality.T - the generic type of the elementsone - the oneother - the otherCollection objects are equal otherwise falsepublic static <T> void difference(Collection<T> one, Collection<T> other)
T - the generic typeone - the collection where the element will be removed if any containing elements existsother - collection containing elements to be removed from the first given collection@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.public static <T> int hashCode(Collection<T[]> arrayObjects)
T - the generic type of the array objectsarrayObjects - the collection that contains array objects whose content-based hash code to
computeCopyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.