Class ElementsSatisfyingConsumer<E>

  • Type Parameters:
    E - element type

    class ElementsSatisfyingConsumer<E>
    extends java.lang.Object
    Wrapper for the list of elements that satisfy certain requirements (expressed as a Consumer).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<E> elements  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      (package private) ElementsSatisfyingConsumer​(java.lang.Iterable<? extends E> actual, java.util.function.Consumer<? super E> assertions)  
      private ElementsSatisfyingConsumer​(java.util.List<E> elements)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static <E> java.util.List<E> filterByPassingAssertions​(java.lang.Iterable<? extends E> actual, java.util.function.Consumer<? super E> assertions)  
      (package private) java.util.List<E> getElements()  
      (package private) ElementsSatisfyingConsumer<E> withoutElement​(E element)
      New ElementsSatisfyingConsumer containing all elements except the (first occurrence of the) given element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • elements

        private final java.util.List<E> elements
    • Constructor Detail

      • ElementsSatisfyingConsumer

        ElementsSatisfyingConsumer​(java.lang.Iterable<? extends E> actual,
                                   java.util.function.Consumer<? super E> assertions)
      • ElementsSatisfyingConsumer

        private ElementsSatisfyingConsumer​(java.util.List<E> elements)
    • Method Detail

      • getElements

        java.util.List<E> getElements()
      • withoutElement

        ElementsSatisfyingConsumer<E> withoutElement​(E element)
        New ElementsSatisfyingConsumer containing all elements except the (first occurrence of the) given element.

        This instance is not modified.

        Parameters:
        element - the element to remove from the result
        Returns:
        all except the given element
      • filterByPassingAssertions

        private static <E> java.util.List<E> filterByPassingAssertions​(java.lang.Iterable<? extends E> actual,
                                                                       java.util.function.Consumer<? super E> assertions)