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> booleancontains(Collection<T> collection, T item)Returnstrueif the specified collection contains the specified item.static <T> booleanintersect(Collection<T> a, Collection<T> b)Returnstrueif the specified collections intersect.static booleanisEmpty(Collection<?> collection)Returnstrueif the specified collection isnullor empty.static booleanisNotEmpty(Collection<?> collection)Returnstrueif the specified collection is not empty.
-
-
-
Method Detail
-
isEmpty
public static boolean isEmpty(Collection<?> collection)
Returnstrueif the specified collection isnullor empty.- Parameters:
collection- The collection. May benull.- Returns:
trueif the collection isnullor empty, elsefalse.
-
isNotEmpty
public static boolean isNotEmpty(Collection<?> collection)
Returnstrueif the specified collection is not empty.- Parameters:
collection- The collection. May benull.- Returns:
trueif the collection is not empty, elsefalse.
-
contains
public static <T> boolean contains(Collection<T> collection, T item)
Returnstrueif the specified collection contains the specified item.- Parameters:
collection- The collection. May benull.item- The item. Should not benull.- Returns:
trueif the collection is not empty and contains the item, elsefalse.
-
intersect
public static <T> boolean intersect(Collection<T> a, Collection<T> b)
Returnstrueif the specified collections intersect.- Parameters:
a- The first collection. May benull.b- The second collection. May benull.- Returns:
trueif the collections intersect, elsefalse.
-
-