Package io.fluxcapacitor.common
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 TypeMethodDescriptionvoid
Performs 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 theafter
operation.
-
Method Details
-
accept
Performs this operation on the given argument.- Parameters:
t
- the input argument- Throws:
Exception
- if unable to process the argument
-
andThen
Returns a composed consumer that performs, in sequence, this operation followed by theafter
operation.- Parameters:
after
- the operation to perform after this operation- Returns:
- a composed
ThrowingConsumer
-