Interface ThrowingConsumer<I,​T extends Throwable>

  • Type Parameters:
    I - the type of the input to the operation
    T - the type of the exception the accept method may throw
    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<I,​T extends Throwable>
    Represents an operation that accepts a single input argument and may thrown an exception.
    See Also:
    Consumer
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void accept​(I in)
      Performs this operation on the given argument, potentially throwing an exception.
    • Method Detail

      • accept

        void accept​(I in)
             throws T extends Throwable
        Performs this operation on the given argument, potentially throwing an exception.
        Parameters:
        in - the function argument
        Throws:
        T - the exception that may be thrown
        T extends Throwable