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> 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 Details
-
isEmpty
Returnstrueif the specified collection isnullor empty.- Parameters:
collection- The collection. May benull.- Returns:
trueif the collection isnullor empty, elsefalse.
-
isNotEmpty
Returnstrueif the specified collection is not empty.- Parameters:
collection- The collection. May benull.- Returns:
trueif the collection is not empty, elsefalse.
-
contains
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
Returnstrueif the specified collections intersect.- Parameters:
a- The first collection. May benull.b- The second collection. May benull.- Returns:
trueif the collections intersect, elsefalse.
-