Interface CIterableState<E>

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default boolean contains​(java.lang.Object o)
      Returns true if this collection contains the specified element.
      default boolean containsAll​(java.lang.Iterable<E> expected, java.util.function.Consumer<E> onNotMatch)
      Check if actual collection contains all elements from the expected collection.
      default boolean containsAny​(java.lang.Iterable<E> expected)
      Check if actual collection contains any element from the expected collection.
      default boolean containsNone​(java.lang.Iterable<E> expected)
      Check if actual collection contains none of elements from the expected collection.
      default boolean containsNone​(java.lang.Iterable<E> expected, java.util.function.Consumer<E> onMatch)
      Check if actual collection contains none of elements from the expected collection.
      default boolean emptyOrContains​(E expected)
      Check if actual collection either is empty or contains the expected element.
      default boolean emptyOrNotContains​(E expected)
      Check if actual collection either is empty or does not contain the expected element.
      default boolean has​(java.util.function.Predicate<E> expected)
      Check if iterable contains any value.
      default boolean hasNot​(java.util.function.Predicate<E> expected)
      Check if iterable contains any value.
      default boolean isEmpty()
      Check if iterable is empty.
      default boolean isEqual​(java.lang.Iterable<E> expected)
      Check if actual and expected collections have the exact same elements.
      default boolean isEqual​(java.lang.Iterable<E> expected, java.util.function.Consumer<E> onActualNotContains, java.util.function.Consumer<E> onExpectedNotContains)
      Check if actual and expected collections have the exact same elements.
      default boolean isNotEmpty()
      Check if iterable contains any value.
      default boolean notContains​(E expected)
      Check if actual collection does not contain the expected element.
      default boolean notContainsAll​(java.lang.Iterable<E> expected)
      Check if actual collection does not contain all elements from the expected collection.
      default boolean notContainsAll​(java.lang.Iterable<E> expected, java.util.function.Consumer<E> onActualContains)
      Check if actual collection does not contain all elements from the expected collection.
    • Method Detail

      • has

        default boolean has​(java.util.function.Predicate<E> expected)
        Check if iterable contains any value.
        Returns:
        execution boolean result
      • hasNot

        default boolean hasNot​(java.util.function.Predicate<E> expected)
        Check if iterable contains any value.
        Returns:
        execution boolean result
      • isNotEmpty

        default boolean isNotEmpty()
        Check if iterable contains any value.
        Returns:
        execution boolean result
      • isEmpty

        default boolean isEmpty()
        Check if iterable is empty.
        Returns:
        execution boolean result
      • contains

        default boolean contains​(java.lang.Object o)
        Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that Objects.equals(o, e).
        Parameters:
        o - element whose presence in this collection is to be tested
        Returns:
        true if this collection contains the specified element
        Throws:
        java.lang.ClassCastException - if the type of the specified element is incompatible with this collection
        java.lang.NullPointerException - if the specified element is null and this collection does not permit null elements
      • containsAny

        default boolean containsAny​(java.lang.Iterable<E> expected)
        Check if actual collection contains any element from the expected collection.
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • containsAll

        default boolean containsAll​(java.lang.Iterable<E> expected,
                                    java.util.function.Consumer<E> onNotMatch)
        Check if actual collection contains all elements from the expected collection. Please note that actual collection might have more elements.
        Parameters:
        expected - value to compare
        onNotMatch - consumer to call if no match found
        Returns:
        execution boolean result
      • containsNone

        default boolean containsNone​(java.lang.Iterable<E> expected)
        Check if actual collection contains none of elements from the expected collection.
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • containsNone

        default boolean containsNone​(java.lang.Iterable<E> expected,
                                     java.util.function.Consumer<E> onMatch)
        Check if actual collection contains none of elements from the expected collection.
        Parameters:
        expected - value to compare
        onMatch - consumer to call if match found
        Returns:
        execution boolean result
      • emptyOrContains

        default boolean emptyOrContains​(E expected)
        Check if actual collection either is empty or contains the expected element.
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • emptyOrNotContains

        default boolean emptyOrNotContains​(E expected)
        Check if actual collection either is empty or does not contain the expected element.
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • isEqual

        default boolean isEqual​(java.lang.Iterable<E> expected)
        Check if actual and expected collections have the exact same elements. (Ignore element order) First we compare that actual collection contains all expected collection elements and then we verify that expected has all elements from actual.
        Specified by:
        isEqual in interface CObjectState<E>
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • isEqual

        default boolean isEqual​(java.lang.Iterable<E> expected,
                                java.util.function.Consumer<E> onActualNotContains,
                                java.util.function.Consumer<E> onExpectedNotContains)
        Check if actual and expected collections have the exact same elements. (Ignore element order) First we compare that actual collection contains all expected collection elements and then we verify that expected has all elements from actual.
        Parameters:
        expected - value to compare
        onActualNotContains - consumer to call if match found
        onExpectedNotContains - consumer to call if match found
        Returns:
        execution boolean result
      • notContains

        default boolean notContains​(E expected)
        Check if actual collection does not contain the expected element.
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • notContainsAll

        default boolean notContainsAll​(java.lang.Iterable<E> expected)
        Check if actual collection does not contain all elements from the expected collection. Please note that actual collection might have some of elements but the point is to ensure that not all expected elements are exist in it.
        Parameters:
        expected - value to compare
        Returns:
        execution boolean result
      • notContainsAll

        default boolean notContainsAll​(java.lang.Iterable<E> expected,
                                       java.util.function.Consumer<E> onActualContains)
        Check if actual collection does not contain all elements from the expected collection. Please note that actual collection might have some of elements but the point is to ensure that not all expected elements are exist in it.
        Parameters:
        onActualContains - consumer to call if match found
        expected - value to compare
        Returns:
        execution boolean result