Package septogeddon.pluginquery
Class QueryFutureAdapter<T>
java.lang.Object
septogeddon.pluginquery.QueryFutureAdapter<T>
- All Implemented Interfaces:
QueryFuture<T>
- Direct Known Subclasses:
QueryChannelFuture,QueryCompletableFuture
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(Consumer<QueryFuture<T>> listener) Add future listenervoidvoidcompleteExceptionally(Throwable cause) voidgetCause()An error that caused the task failed to do its jobA result from current finished taskbooleanisDone()Check whether the task is done executed no matter what happen to the taskbooleanCheck whether the task is successfully executedvoidremoveListener(Consumer<QueryFuture<T>> listener) Remove future listenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface septogeddon.pluginquery.api.QueryFuture
joinThread, joinThread, printStackTrace, thenAccept
-
Field Details
-
result
-
cause
-
done
protected boolean done
-
-
Constructor Details
-
QueryFutureAdapter
public QueryFutureAdapter()
-
-
Method Details
-
complete
-
fireEvent
public void fireEvent() -
completeExceptionally
-
isDone
public boolean isDone()Description copied from interface:QueryFutureCheck whether the task is done executed no matter what happen to the task- Specified by:
isDonein interfaceQueryFuture<T>- Returns:
-
isSuccess
public boolean isSuccess()Description copied from interface:QueryFutureCheck whether the task is successfully executed- Specified by:
isSuccessin interfaceQueryFuture<T>- Returns:
-
getCause
Description copied from interface:QueryFutureAn error that caused the task failed to do its job- Specified by:
getCausein interfaceQueryFuture<T>- Returns:
-
getResult
Description copied from interface:QueryFutureA result from current finished task- Specified by:
getResultin interfaceQueryFuture<T>- Returns:
-
addListener
Description copied from interface:QueryFutureAdd future listener- Specified by:
addListenerin interfaceQueryFuture<T>- Parameters:
listener-
-
removeListener
Description copied from interface:QueryFutureRemove future listener- Specified by:
removeListenerin interfaceQueryFuture<T>- Parameters:
listener-
-