Interface FailableSupplier<T,​E extends Exception>

  • Type Parameters:
    T - The type of the data being returned
    E - 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 Detail

      • fromSupplier

        static <T,​E extends ExceptionFailableSupplier<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)