Interface FailableSupplier<T,E extends Exception>

Type Parameters:
T - the type of results supplied by this supplier
E - the type of the exception thrown by the supplier
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>
Represents a supplier of results which can throw exceptions.
Since:
4.1.19
  • Method Details

    • get

      T get() throws E
      Gets a result.
      Returns:
      a result
      Throws:
      E - an exception
    • wrapper

      static <T, E extends Exception> Supplier<T> wrapper(FailableSupplier<T,E> supplier)
      Wrapper responsible for converting a certain FailableSupplier into a Supplier.
      Type Parameters:
      T - the type of results supplied by this supplier
      E - the type of the exception thrown by the supplier
      Parameters:
      supplier - The supplier function to be converted.
      Returns:
      The build Supplier.