Package org.consensusj.jsonrpc
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.
Subinterface of
Supplier
for Lambdas which throw IOException
.
Can be used for two purposes:
- To cast a lambda that throws an
IOException
to aSupplier
while automatically wrapping any exception thrown by the lambda withRuntimeException
. - As a
FunctionalInterface
where a lambda that throws exceptions is expected or allowed.
JsonRpcClient
that throw IOException
and
subclasses such as JsonRpcException
, so we have narrowed the allowed exceptions in getThrows()
to
IOException
.-
Method Summary
Modifier and TypeMethodDescriptiondefault T
get()
Gets a result wrapping checked Exceptions withRuntimeException
Gets a result.
-
Method Details
-
get
Gets a result wrapping checked Exceptions withRuntimeException
-
getThrows
Gets a result.- Returns:
- a result
- Throws:
IOException
- A (checked) exception
-