Interface Stage.Peek

  • All Superinterfaces:
    Stage
    Enclosing interface:
    Stage

    public static interface Stage.Peek
    extends Stage
    A stage returning a stream containing all the elements from this stream, additionally performing the provided action on each element.

    The given consumer function must be invoked on each element consumed.

    Any RuntimeException thrown by the function must be propagated downstream as an error, and upstream must be cancelled. Any subsequent elements received from upstream before the cancellation signal is handled must be dropped.

    • Method Detail

      • getConsumer

        java.util.function.Consumer<?> getConsumer()
        The consumer function.
        Returns:
        The consumer function.