| Modifier and Type | Method and Description |
|---|---|
static <T> Supplier<T> |
safe(ThrowableSupplier<? extends T,java.lang.Throwable> throwableSupplier)
Creates a safe
Supplier. |
static <T> Supplier<T> |
safe(ThrowableSupplier<? extends T,java.lang.Throwable> throwableSupplier,
T resultIfFailed)
Creates a safe
Supplier. |
public static <T> Supplier<T> safe(@NotNull ThrowableSupplier<? extends T,java.lang.Throwable> throwableSupplier)
Supplier.T - the type of the resultthrowableSupplier - the supplier that may throw an exceptionSupplierjava.lang.NullPointerException - if throwableSupplier is nullsafe(com.annimon.stream.function.ThrowableSupplier, java.lang.Object)public static <T> Supplier<T> safe(@NotNull ThrowableSupplier<? extends T,java.lang.Throwable> throwableSupplier, @Nullable T resultIfFailed)
Supplier.T - the type of the resultthrowableSupplier - the supplier that may throw an exceptionresultIfFailed - the result which returned if exception was thrownSupplierjava.lang.NullPointerException - if throwableSupplier is null