Interface CheckedConsumer<T,E extends Throwable>

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 CheckedConsumer<T,E extends Throwable>
A consumer that can throw checked exceptions.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    accept(T input)
     
    andThen(CheckedConsumer<? super T,E> that)
    Returns a new CheckedConsumer that also passes the input to that.
  • Method Details Link icon

    • accept Link icon

      void accept(T input) throws E
      Throws:
      E
    • andThen Link icon

      default CheckedConsumer<T,E> andThen(CheckedConsumer<? super T,E> that)
      Returns a new CheckedConsumer that also passes the input to that. For example: out::writeObject.andThen(logger::info).accept("message").