Function that allows invocation of code that throws a checked
exception.
| Modifier and Type | Method and Description |
|---|---|
| public default R | apply(T
the function argument t)Implements java. Default |
| public default R | Returns: a resultBiFunction that wraps the given message
and checked exception into a runtime exceptionApplies this function to the given argument, wrapping any thrown checked
exceptions using the given |
| public R | Returns: the function resultthe function argument t)Applies this function to the given argument, possibly throwing a checked exception. |
| public static < the type of the input to the function T, the type of the result of the function R> ThrowingFunction | Returns: a newThrowingFunction instancethe source function function)Lambda friendly convenience method that can be used to create a
|
| public static < the type of the input to the function T, the type of the result of the function R> ThrowingFunction | Returns: a newThrowingFunction instancethe source function function, BiFunction<String, Exception, RuntimeException> the exception wrapper to use exceptionWrapper)Lambda friendly convenience method that can be used to create a
|
| public default ThrowingFunction | Returns: the replacementThrowingFunction instanceBiFunction that wraps the given message
and checked exception into a runtime exceptionReturn a new |
| apply | back to summary |
|---|---|
| public default R apply(T t) Implements java. Default
| |
| apply | back to summary |
|---|---|
| public default R apply(T t, BiFunction<String, Exception, RuntimeException> exceptionWrapper) Applies this function to the given argument, wrapping any thrown checked
exceptions using the given
| |
| applyWithException | back to summary |
|---|---|
| public R applyWithException(T t) throws Exception Applies this function to the given argument, possibly throwing a checked exception.
| |
| of | back to summary |
|---|---|
| public static <T, R> ThrowingFunction Lambda friendly convenience method that can be used to create a
This method can be especially useful when working with method references.
It allows you to easily convert a method that throws a checked exception
into an instance compatible with a regular For example: stream.map(ThrowingFunction.of(Example::methodThatCanThrowCheckedException));
| |
| of | back to summary |
|---|---|
| public static <T, R> ThrowingFunction Lambda friendly convenience method that can be used to create a
This method can be especially useful when working with method references.
It allows you to easily convert a method that throws a checked exception
into an instance compatible with a regular For example: stream.map(ThrowingFunction.of(Example::methodThatCanThrowCheckedException, IllegalStateException::new));
| |
| throwing | back to summary |
|---|---|
| public default ThrowingFunction Return a new
| |