Interface FutureUtils.ThrowingSupplier<T>

  • Type Parameters:
    T - the supplied type
    All Superinterfaces:
    Enclosing class:
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    public static interface FutureUtils.ThrowingSupplier<T>
    extends java.util.function.Supplier<T>
    Subinterface of Supplier for Lambdas which throw exceptions. Can be used for two purposes: 1. To cast a lambda that throws an exception to a Supplier and automatically wrapping any exceptions with RuntimeException. 2. As a FunctionalInterface where a lambda that throws exceptions is expected or allowed.
    • Method Detail

      • get

        default T get()
        Gets a result wrapping checked Exceptions with RuntimeException
        Specified by:
        get in interface java.util.function.Supplier<T>
        a result
      • getThrows

        T getThrows()
             throws java.lang.Exception
        Gets a result.
        a result
        java.lang.Exception - Any checked Exception