Interface ThrowingConsumer<A>

Type Parameters:
A - the type of the first argument to the operation.
All Superinterfaces:
Consumer<A>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ThrowingConsumer<A> extends Consumer<A>
Represents an operation that accepts one input argument and returns no result. This is the throwing specialization of Consumer.

This is a functional interface whose functional method is accept(Object).

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    accept​(A a)
     
    void
    Performs this operation on the given arguments.

    Methods inherited from interface java.util.function.Consumer

    andThen
  • Method Details

    • acceptThrows

      void acceptThrows(A a) throws RuntimeException
      Performs this operation on the given arguments.
      Parameters:
      a - the first input argument.
      Throws:
      RuntimeException - Thrown if any exception happens during lambda execution.
    • accept

      default void accept(A a)
      Specified by:
      accept in interface Consumer<A>