Interface AsyncSupport.ThrowingSupplier<T>

Type Parameters:
T -
All Superinterfaces:
Supplier<T>
Enclosing interface:
AsyncSupport
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 static interface AsyncSupport.ThrowingSupplier<T> extends Supplier<T>
Subinterface of Supplier for Lambdas which throw IOException. Can be used for two purposes:
  1. To cast a lambda that throws an IOException to a Supplier while automatically wrapping any exception thrown by the lambda with RuntimeException.
  2. As a FunctionalInterface where a lambda that throws exceptions is expected or allowed.
This is intended to be used to wrap JSON-RPC I/O methods of JsonRpcClient that throw IOException and subclasses such as JsonRpcException, so we have narrowed the allowed exceptions in getThrows() to IOException.
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    get()
    Gets a result wrapping checked Exceptions with RuntimeException
    Gets a result.