V
- The result type returned by this Future's get()
and get(long, TimeUnit)
methods.public interface UncheckedFuture<V> extends Future<V>
Future
that throws unchecked instead checked exceptions.Modifier and Type | Method and Description |
---|---|
V |
get()
Gets per
Future.get() but rethrows checked exceptions as unchecked. |
V |
get(long timeout,
TimeUnit unit)
Gets per
Future.get(long, TimeUnit) but rethrows checked exceptions as unchecked. |
static <T> Stream<UncheckedFuture<T>> |
map(Collection<Future<T>> futures)
Maps the given instances as unchecked.
|
static <T> Collection<UncheckedFuture<T>> |
on(Collection<Future<T>> futures)
Maps the given instances as unchecked.
|
static <T> UncheckedFuture<T> |
on(Future<T> future)
Creates a new instance on the given Future.
|
cancel, isCancelled, isDone
static <T> Stream<UncheckedFuture<T>> map(Collection<Future<T>> futures)
T
- The result type returned by the Futures' get()
and get(long, TimeUnit)
methods.futures
- The Futures to uncheck.static <T> Collection<UncheckedFuture<T>> on(Collection<Future<T>> futures)
T
- The result type returned by the Futures' get()
and get(long, TimeUnit)
methods.futures
- The Futures to uncheck.static <T> UncheckedFuture<T> on(Future<T> future)
T
- The result type returned by this Future's get()
and get(long, TimeUnit)
methods.future
- The Future to uncheck.V get()
Future.get()
but rethrows checked exceptions as unchecked.
The default mapping from checked to unchecked is:
V get(long timeout, TimeUnit unit)
Future.get(long, TimeUnit)
but rethrows checked exceptions as unchecked.
The default mapping from checked to unchecked is:
Copyright © 2001–2023 The Apache Software Foundation. All rights reserved.