public class FutureUtils
extends java.lang.Object
Constructor | Description |
---|---|
FutureUtils() |
Modifier and Type | Method | Description |
---|---|---|
static boolean |
cancel(java.util.concurrent.Future<?> toCancel) |
|
static <T> T |
get(java.util.concurrent.Future<T> future) |
Calls
Future.get() without the checked exceptions. |
static <T> T |
get(java.util.concurrent.Future<T> future,
long timeout,
java.util.concurrent.TimeUnit unit) |
Calls
Future.get(long, TimeUnit) without the checked exceptions. |
public static boolean cancel(java.util.concurrent.Future<?> toCancel)
public static <T> T get(java.util.concurrent.Future<T> future)
Future.get()
without the checked exceptions.T
- the type returnedfuture
- to dereferencepublic static <T> T get(java.util.concurrent.Future<T> future, long timeout, java.util.concurrent.TimeUnit unit)
Future.get(long, TimeUnit)
without the checked exceptions.T
- the type returnedfuture
- to dereferencetimeout
- to waitunit
- for timeout