Interface ThrowingConsumer<T>
-
- Type Parameters:
T- the type of the input to the operation
- 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<T>This interface replacesConsumerin cases when execution ofaccept(Object)method may throw exception.Useful for capturing lambdas that throw exceptions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccept(T t)Performs this operation on the given argument.
-
-
-
Method Detail
-
accept
void accept(T t) throws java.lang.Throwable
Performs this operation on the given argument.- Parameters:
t- input argument- Throws:
java.lang.Throwable- exception that may be thrown
-
-