Package apoc.util

Class CollectionUtils

java.lang.Object
apoc.util.CollectionUtils

public final class CollectionUtils extends Object
  • Method Details

    • isEmpty

      public static boolean isEmpty(Collection<?> coll)
      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

      public static boolean isNotEmpty(Collection<?> coll)
      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

      public static <T> boolean containsAny(Collection<?> coll1, T... coll2)
      Returns true iff at least one element is in both collections.
      Type Parameters:
      T - the type of object to lookup in coll1.
      Parameters:
      coll1 - the first collection, must not be null
      coll2 - the second collection, must not be null
      Returns:
      true iff the intersection of the collections is non-empty