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

    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

    • accept

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

      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").