Package com.nimbusds.oauth2.sdk.util
Class CollectionUtils
java.lang.Object
com.nimbusds.oauth2.sdk.util.CollectionUtils
Collection utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> boolean
contains
(Collection<T> collection, T item) Returnstrue
if the specified collection contains the specified item.static <T> boolean
intersect
(Collection<T> a, Collection<T> b) Returnstrue
if the specified collections intersect.static boolean
isEmpty
(Collection<?> collection) Returnstrue
if the specified collection isnull
or empty.static boolean
isNotEmpty
(Collection<?> collection) Returnstrue
if the specified collection is not empty.
-
Method Details
-
isEmpty
Returnstrue
if the specified collection isnull
or empty.- Parameters:
collection
- The collection. May benull
.- Returns:
true
if the collection isnull
or empty, elsefalse
.
-
isNotEmpty
Returnstrue
if the specified collection is not empty.- Parameters:
collection
- The collection. May benull
.- Returns:
true
if the collection is not empty, elsefalse
.
-
contains
Returnstrue
if the specified collection contains the specified item.- Parameters:
collection
- The collection. May benull
.item
- The item. Should not benull
.- Returns:
true
if the collection is not empty and contains the item, elsefalse
.
-
intersect
Returnstrue
if the specified collections intersect.- Parameters:
a
- The first collection. May benull
.b
- The second collection. May benull
.- Returns:
true
if the collections intersect, elsefalse
.
-