Modifier and Type | Field and Description |
---|---|
DelegatingFuture<T> |
delegatingFuture |
Constructor and Description |
---|
FutureImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
void |
complete(T value)
Complete this future successfully.
|
void |
fail(Throwable t)
Complete this future unsuccessfully.
|
T |
get() |
T |
get(long timeout,
TimeUnit unit) |
T |
getOrThrowUnchecked(String errorMessage)
Call
get() , and re-throw any checked exceptions as an unchecked RuntimeException with the provided
message. |
boolean |
isCancelled() |
boolean |
isDone() |
public final DelegatingFuture<T> delegatingFuture
public void complete(T value)
public void fail(Throwable t)
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
isCancelled
in interface Future<T>
public T getOrThrowUnchecked(String errorMessage)
get()
, and re-throw any checked exceptions as an unchecked RuntimeException
with the provided
message.public T get() throws InterruptedException, ExecutionException
get
in interface Future<T>
InterruptedException
ExecutionException
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<T>
InterruptedException
ExecutionException
TimeoutException
Copyright © 2022. All rights reserved.