Interface TerminatingConsumer<T>

Type Parameters:
T - the type of the input to the operation
All Superinterfaces:
Consumer<T>

public interface TerminatingConsumer<T> extends Consumer<T>
TerminatingConsumer is a Consumer Consumer that can request termination of the supplier once some condition is reached, for example some number of consumed results accepted. If termination is required override the terminationRequested() method to return true when termination state is reached.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
     

    Methods inherited from interface java.util.function.Consumer

    accept, andThen
  • Method Details

    • terminationRequested

      default boolean terminationRequested()