Module io.smallrye.common.function
Package io.smallrye.common.function
Interface ExceptionFunction<T,R,E extends Exception>
- Type Parameters:
T- the argument typeR- the result typeE- the exception type
- All Known Subinterfaces:
ExceptionUnaryOperator<T,E>
- 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 function which can throw an exception.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ExceptionConsumer<T, E> andThen(ExceptionBiConsumer<? super T, ? super R, ? extends E> after) Returns a consumer which passes the argument to, and result of, this function to the given consumer.default <R2> ExceptionFunction<T, R2, E> andThen(ExceptionBiFunction<? super T, ? super R, ? extends R2, ? extends E> after) Returns a function which applies the argument to, and result of, this function to the given function.default ExceptionPredicate<T, E> andThen(ExceptionBiPredicate<? super T, ? super R, ? extends E> after) Returns a predicate that istruewhen the given predicate istruefor arguments passed through this function.default ExceptionConsumer<T, E> andThen(ExceptionConsumer<? super R, ? extends E> after) Returns a consumer which passes the result of this function to the given consumer.default <R2> ExceptionFunction<T, R2, E> andThen(ExceptionFunction<? super R, ? extends R2, ? extends E> after) Returns a function which applies the result of this function to the given function.default ExceptionPredicate<T, E> andThen(ExceptionPredicate<? super R, ? extends E> after) Returns a predicate that istruewhen the given predicate istruefor arguments passed through this function.Applies this function to the given arguments.default <T2> ExceptionFunction<T2, R, E> compose(ExceptionFunction<? super T2, ? extends T, ? extends E> before) Returns a function which applies the result of the given function to this function.default ExceptionSupplier<R, E> compose(ExceptionSupplier<? extends T, ? extends E> before) Returns a supplier which returns the result of this function when applied to the given supplier.
-
Method Details
-
apply
Applies this function to the given arguments.- Parameters:
t- the argument- Returns:
- the function result
- Throws:
E- if an exception occurs
-
andThen
default <R2> ExceptionFunction<T,R2, andThenE> (ExceptionFunction<? super R, ? extends R2, ? extends E> after) Returns a function which applies the result of this function to the given function.- Type Parameters:
R2- the final result type- Parameters:
after- the next function (must not benull)- Returns:
- a function which applies the result of this function to the given function
-
andThen
default <R2> ExceptionFunction<T,R2, andThenE> (ExceptionBiFunction<? super T, ? super R, ? extends R2, ? extends E> after) Returns a function which applies the argument to, and result of, this function to the given function.- Type Parameters:
R2- the final result type- Parameters:
after- the next function (must not benull)- Returns:
- a function which applies the argument to, and result of, this function to the given function
-
compose
default <T2> ExceptionFunction<T2,R, composeE> (ExceptionFunction<? super T2, ? extends T, ? extends E> before) Returns a function which applies the result of the given function to this function.- Type Parameters:
T2- the intermediate argument type- Parameters:
before- the first function (must not benull)- Returns:
- a function which applies the result of the given function to this function
-
andThen
Returns a consumer which passes the result of this function to the given consumer.- Parameters:
after- the consumer (must not benull)- Returns:
- a consumer which passes the result of this function to the given consumer
-
andThen
Returns a consumer which passes the argument to, and result of, this function to the given consumer.- Parameters:
after- the consumer (must not benull)- Returns:
- a consumer which passes the argument to, and result of, this function to the given consumer
-
andThen
Returns a predicate that istruewhen the given predicate istruefor arguments passed through this function.- Parameters:
after- the predicate (must not benull)- Returns:
- a predicate that is
truewhen the given predicate istruefor arguments passed through this function
-
andThen
default ExceptionPredicate<T,E> andThen(ExceptionBiPredicate<? super T, ? super R, ? extends E> after) Returns a predicate that istruewhen the given predicate istruefor arguments passed through this function.- Parameters:
after- the predicate (must not benull)- Returns:
- a predicate that is
truewhen the given predicate istruefor arguments passed through this function
-
compose
Returns a supplier which returns the result of this function when applied to the given supplier.- Parameters:
before- the supplier (must not benull)- Returns:
- a supplier which returns the result of this function when applied to the given supplier
-