Package org.pipecraft.infra.concurrent
Interface FailableSupplier<T,E extends Exception>
-
- Type Parameters:
T- The type of the data being returnedE- The exception type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface FailableSupplier<T,E extends Exception>
A supplier that may fail with a checked exception during the execution of the get() method.- Author:
- Shai Barad
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T,E extends Exception>
FailableSupplier<T,E>fromSupplier(Supplier<T> supplier)Utility method for wrapping a supplier with a failable supplierTget()Gets a result.
-
-
-
Method Detail
-
fromSupplier
static <T,E extends Exception> FailableSupplier<T,E> fromSupplier(Supplier<T> supplier)
Utility method for wrapping a supplier with a failable supplier- Parameters:
supplier- The supplier to wrap- Returns:
- The failable supplier (which effectively never throws checked exceptions)
-
-