Package io.deephaven.util.function
Interface ThrowingSupplier<T,E extends Exception>
- Type Parameters:
T
- The type of the output of the supplierE
- The type of the exception that may be thrown
- All Known Subinterfaces:
SerializationUtils.Reader<ITEM_TYPE>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents an operation that accepts no input and returns a result, declaring a possibly-thrown exception.
-
Method Summary
Modifier and TypeMethodDescriptionget()
SeeSupplier.get()
.static <T,
E extends Exception>
TwrapUnexpectedException
(@NotNull ThrowingSupplier<T, E> supplier) Allow adapting aThrowingSupplier
to the signature forSupplier.get()
, catching any thrownexceptions
and wrapping them inruntime exceptions
.
-
Method Details
-
get
SeeSupplier.get()
. -
wrapUnexpectedException
static <T,E extends Exception> T wrapUnexpectedException(@NotNull @NotNull ThrowingSupplier<T, E> supplier) Allow adapting aThrowingSupplier
to the signature forSupplier.get()
, catching any thrownexceptions
and wrapping them inruntime exceptions
.- Type Parameters:
T
- The type of the resultE
- The type of the exception that might be thrown bysupplier
- Parameters:
supplier
- The supplier to adapt- Returns:
- The result of
supplier
-