Module io.smallrye.common.function
Package io.smallrye.common.function
Interface ExceptionConsumer<T,E extends Exception>
- Type Parameters:
T- the argument typeE- the exception type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A one-argument consumer which can throw an exception.
-
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms this operation on the given argument.default ExceptionConsumer<T, E> andThen(ExceptionConsumer<? super T, ? extends E> after) Returns a consumer which passes the argument to this consumer followed by the given consumer.default ExceptionConsumer<T, E> compose(ExceptionConsumer<? super T, ? extends E> before) Returns a consumer which passes the argument to the given consumer followed by this consumer.default ExceptionRunnable<E> compose(ExceptionSupplier<? extends T, ? extends E> before) Returns a runnable which passes the result of the given supplier to this consumer.
-
Method Details
-
accept
Performs this operation on the given argument.- Parameters:
t- the argument- Throws:
E- if an exception occurs
-
andThen
Returns a consumer which passes the argument to this consumer followed by the given consumer.- Parameters:
after- the next consumer (must not benull)- Returns:
- a consumer which passes the argument to this consumer followed by the given consumer
-
compose
Returns a consumer which passes the argument to the given consumer followed by this consumer.- Parameters:
before- the first consumer (must not benull)- Returns:
- a consumer which passes the argument to the given consumer followed by this consumer
-
compose
Returns a runnable which passes the result of the given supplier to this consumer.- Parameters:
before- the suppler (must not benull)- Returns:
- a runnable which passes the result of the given supplier to this consumer
-