Package apoc.util
Class CollectionUtils
java.lang.Object
apoc.util.CollectionUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> booleancontainsAny(Collection<?> coll1, T... coll2) Returnstrueiff at least one element is in both collections.static booleanisEmpty(Collection<?> coll) Null-safe check if the specified collection is empty.static booleanisNotEmpty(Collection<?> coll) Null-safe check if the specified collection is not empty.
-
Method Details
-
isEmpty
Null-safe check if the specified collection is empty.- Parameters:
coll- the collection to check, may be null- Returns:
- true if empty or null
-
isNotEmpty
Null-safe check if the specified collection is not empty.- Parameters:
coll- the collection to check, may be null- Returns:
- true if non-null and non-empty
-
containsAny
Returnstrueiff at least one element is in both collections.- Type Parameters:
T- the type of object to lookup incoll1.- Parameters:
coll1- the first collection, must not be nullcoll2- the second collection, must not be null- Returns:
trueiff the intersection of the collections is non-empty
-