Package io.activej.common.function
Interface SupplierEx<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents a
Supplier capable of throwing exceptions-
Method Summary
Modifier and TypeMethodDescriptionget()static <T> SupplierEx<T>Creates aSupplierExout ofSupplierstatic <T> Supplier<T>uncheckedOf(SupplierEx<T> checkedFn) Creates aSupplierout ofSupplierEx
-
Method Details
-
get
- Throws:
Exception
-
of
Creates aSupplierExout ofSupplierIf given supplier throws
UncheckedException, its cause will be propagated- Parameters:
uncheckedFn- originalSupplier- Returns:
- a supplier capable of throwing exceptions
-
uncheckedOf
Creates aSupplierout ofSupplierExIf given supplier throws a checked exception, it will be wrapped into
UncheckedExceptionand rethrownUnchecked exceptions will be handled by thread's
FatalErrorHandler- Parameters:
checkedFn- originalSupplierEx- Returns:
- a supplier
-