Interface UncheckedFuture<V>
- Type Parameters:
V
- The result type returned by this Future'sget()
andget(long, TimeUnit)
methods.
- All Superinterfaces:
Future<V>
An
Future
that throws unchecked instead checked exceptions.-
Method Summary
Modifier and TypeMethodDescriptionget()
Gets perFuture.get()
but rethrows checked exceptions as unchecked.Gets perFuture.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>
Creates a new instance on the given Future.Methods inherited from interface java.util.concurrent.Future
cancel, isCancelled, isDone
-
Method Details
-
map
Maps the given instances as unchecked.- Type Parameters:
T
- The result type returned by the Futures'get()
andget(long, TimeUnit)
methods.- Parameters:
futures
- The Futures to uncheck.- Returns:
- a new stream.
-
on
Maps the given instances as unchecked.- Type Parameters:
T
- The result type returned by the Futures'get()
andget(long, TimeUnit)
methods.- Parameters:
futures
- The Futures to uncheck.- Returns:
- a new collection.
-
on
Creates a new instance on the given Future.- Type Parameters:
T
- The result type returned by this Future'sget()
andget(long, TimeUnit)
methods.- Parameters:
future
- The Future to uncheck.- Returns:
- a new instance.
-
get
Gets perFuture.get()
but rethrows checked exceptions as unchecked.The default mapping from checked to unchecked is:
-
get
Gets perFuture.get(long, TimeUnit)
but rethrows checked exceptions as unchecked.The default mapping from checked to unchecked is:
-