Class FutureUtils
- java.lang.Object
-
- org.elasticsearch.common.util.concurrent.FutureUtils
-
public class FutureUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FutureUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancancel(java.util.concurrent.Future<?> toCancel)static <T> Tget(java.util.concurrent.Future<T> future)CallsFuture.get()without the checked exceptions.static <T> Tget(java.util.concurrent.Future<T> future, long timeout, java.util.concurrent.TimeUnit unit)CallsFuture.get(long, TimeUnit)without the checked exceptions.
-
-
-
Method Detail
-
cancel
public static boolean cancel(java.util.concurrent.Future<?> toCancel)
-
get
public static <T> T get(java.util.concurrent.Future<T> future)
CallsFuture.get()without the checked exceptions.- Type Parameters:
T- the type returned- Parameters:
future- to dereference- Returns:
- the value of the future
-
get
public static <T> T get(java.util.concurrent.Future<T> future, long timeout, java.util.concurrent.TimeUnit unit)CallsFuture.get(long, TimeUnit)without the checked exceptions.- Type Parameters:
T- the type returned- Parameters:
future- to dereferencetimeout- to waitunit- for timeout- Returns:
- the value of the future
-
-