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. Replicates Apache Commons Collections.
-
-
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 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
.
-
-