Interface ThrowableSupplier<T,​E extends java.lang.Throwable>

Type Parameters:
T - The type this supplier is supposed to return.
E - The type of exception this Supplier is expected to throw.
All Superinterfaces:
java.util.function.Supplier<T>
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 ThrowableSupplier<T,​E extends java.lang.Throwable>
extends java.util.function.Supplier<T>
Simple hack to add checked error support to a Suppliers. It is mainly used in conjunction with Utilities.supplierHandling(ThrowableSupplier, Consumer) to achieve error handling within a Supplier.
Author:
Collin Alpert
See Also:
Supplier
  • Method Summary

    Modifier and Type Method Description
    T fetch()  
    default T get()  
  • Method Details

    • fetch

      T fetch() throws E extends java.lang.Throwable
      Throws:
      E extends java.lang.Throwable
    • get

      default T get()
      Specified by:
      get in interface java.util.function.Supplier<T>