Module io.smallrye.common.function
Package io.smallrye.common.function
Interface ExceptionSupplier<T,E extends Exception>
- Type Parameters:
T- the result 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 supplier which can throw an exception.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ExceptionRunnable<E> andThen(ExceptionConsumer<? super T, ? extends E> after) Returns a runnable which passes the result of this supplier to the given consumer.default <R> ExceptionSupplier<R, E> andThen(ExceptionFunction<? super T, ? extends R, ? extends E> after) Returns a supplier which passes the result of this supplier through the given function.get()Gets a result.
-
Method Details
-
get
Gets a result.- Returns:
- the result
- Throws:
E- if an exception occurs
-
andThen
Returns a runnable which passes the result of this supplier to the given consumer.- Parameters:
after- the consumer (must not benull)- Returns:
- a runnable which passes the result of this supplier to the given consumer
-
andThen
default <R> ExceptionSupplier<R,E> andThen(ExceptionFunction<? super T, ? extends R, ? extends E> after) Returns a supplier which passes the result of this supplier through the given function.- Type Parameters:
R- the result type- Parameters:
after- the function (must not benull)- Returns:
- a supplier which passes the result of this supplier through the given function
-