Supplier that allows invocation of code that throws a checked exception.
| Modifier and Type | Method and Description |
|---|---|
| public default T | get()
Implements java. Supplier#get() that wraps any thrown checked exceptions
(by default in a RuntimeException).
|
| public default T | Returns: a resultBiFunction that wraps the given message
and checked exception into a runtime exceptionGets a result, wrapping any thrown checked exceptions using the given
|
| public T | |
| public static < the type of results supplied by this supplier T> ThrowingSupplier | Returns: a newThrowingSupplier instancethe source supplier supplier)Lambda friendly convenience method that can be used to create a
|
| public static < the type of results supplied by this supplier T> ThrowingSupplier | Returns: a newThrowingSupplier instancethe source supplier supplier, BiFunction<String, Exception, RuntimeException> the exception wrapper to use exceptionWrapper)Lambda friendly convenience method that can be used to create
|
| public default ThrowingSupplier | Returns: the replacementThrowingSupplier instanceBiFunction that wraps the given message
and checked exception into a runtime exceptionReturn a new |
| get | back to summary |
|---|---|
| public default T get() Implements java. Default
| |
| get | back to summary |
|---|---|
| public default T get(BiFunction<String, Exception, RuntimeException> exceptionWrapper) Gets a result, wrapping any thrown checked exceptions using the given
| |
| getWithException | back to summary |
|---|---|
| public T getWithException() throws Exception Gets a result, possibly throwing a checked exception.
| |
| of | back to summary |
|---|---|
| public static <T> ThrowingSupplier 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: optional.orElseGet(ThrowingSupplier.of(Example::methodThatCanThrowCheckedException));
| |
| of | back to summary |
|---|---|
| public static <T> ThrowingSupplier Lambda friendly convenience method that can be used to create
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: optional.orElseGet(ThrowingSupplier.of(Example::methodThatCanThrowCheckedException, IllegalStateException::new));
| |
| throwing | back to summary |
|---|---|
| public default ThrowingSupplier Return a new
| |