T - operation result representation.public static class Operations.CompletedFuture<T> extends Object implements Future<T>
Future in the completed state with a fixed result.
 The outcome of the future cannot be altered and it cannot be cancelled.| Constructor and Description | 
|---|
| CompletedFuture(T result) | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | cancel(boolean mayInterruptIfRunning) | 
| T | get() | 
| T | get(long timeout,
   TimeUnit unit) | 
| boolean | isCancelled() | 
| boolean | isDone() | 
public CompletedFuture(T result)
public T get() throws InterruptedException, ExecutionException
get in interface Future<T>InterruptedExceptionExecutionExceptionpublic T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<T>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled in interface Future<T>Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.