public final class ExceptionHelper
extends java.lang.Object
| Constructor and Description |
|---|
ExceptionHelper() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getOrDefault(ThrowingSupplier<T> supplier,
java.util.function.Function<java.lang.Throwable,T> defaultObject)
Gets a result or defaults if a throwable is thrown.
|
static <T> T |
getOrDefault(ThrowingSupplier<T> supplier,
java.util.function.Supplier<T> defaultObject)
Gets a result or defaults if a throwable is thrown.
|
public static <T> T getOrDefault(ThrowingSupplier<T> supplier, java.util.function.Supplier<T> defaultObject)
T - the type of the resultsupplier - the supplied resultdefaultObject - the defaulted result if a throwable is throwndefaultObject should never throw a throwable.public static <T> T getOrDefault(ThrowingSupplier<T> supplier, java.util.function.Function<java.lang.Throwable,T> defaultObject)
T - the type of the resultsupplier - the supplied resultdefaultObject - a function to construct a default object from the
thrown throwabledefaultObject should never throw a throwable.