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

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

      • accept

        void accept​(T input)
             throws E extends java.lang.Throwable
        Throws:
        E extends java.lang.Throwable
      • 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").