Package com.nimbusds.oauth2.sdk.util
Class CollectionUtils
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.util.CollectionUtils
-
public final class CollectionUtils extends Object
Collection utilities.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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 Detail
-
isEmpty
public static boolean isEmpty(Collection<?> collection)
Returnstrue
if the specified collection isnull
or empty.- Parameters:
collection
- The collection. May benull
.- Returns:
true
if the collection isnull
or empty, elsefalse
.
-
isNotEmpty
public static boolean isNotEmpty(Collection<?> collection)
Returnstrue
if the specified collection is not empty.- Parameters:
collection
- The collection. May benull
.- Returns:
true
if the collection is not empty, elsefalse
.
-
contains
public static <T> boolean contains(Collection<T> collection, T item)
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
public static <T> boolean intersect(Collection<T> a, Collection<T> b)
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
.
-
-