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.
Functional counterpart to
Consumer that allows the accept(Object) method to
throw a checked Exception.
This is useful when working with streams or other functional APIs that need to propagate exceptions.
-
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms this operation on the given argument.default ThrowingConsumer<T> andThen(@NonNull ThrowingConsumer<? super T> after) Returns a composed consumer that performs, in sequence, this operation followed by theafteroperation.
-
Method Details
-
accept
-
andThen
Returns a composed consumer that performs, in sequence, this operation followed by theafteroperation.- Parameters:
after- the operation to perform after this operation- Returns:
- a composed
ThrowingConsumer
-