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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(Consumer<QueryFuture<T>> listener) Add future listenervoid
void
completeExceptionally
(Throwable cause) void
getCause()
An error that caused the task failed to do its jobA result from current finished taskboolean
isDone()
Check whether the task is done executed no matter what happen to the taskboolean
Check whether the task is successfully executedvoid
removeListener
(Consumer<QueryFuture<T>> listener) Remove future listenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:QueryFuture
Check whether the task is done executed no matter what happen to the task- Specified by:
isDone
in interfaceQueryFuture<T>
- Returns:
-
isSuccess
public boolean isSuccess()Description copied from interface:QueryFuture
Check whether the task is successfully executed- Specified by:
isSuccess
in interfaceQueryFuture<T>
- Returns:
-
getCause
Description copied from interface:QueryFuture
An error that caused the task failed to do its job- Specified by:
getCause
in interfaceQueryFuture<T>
- Returns:
-
getResult
Description copied from interface:QueryFuture
A result from current finished task- Specified by:
getResult
in interfaceQueryFuture<T>
- Returns:
-
addListener
Description copied from interface:QueryFuture
Add future listener- Specified by:
addListener
in interfaceQueryFuture<T>
- Parameters:
listener
-
-
removeListener
Description copied from interface:QueryFuture
Remove future listener- Specified by:
removeListener
in interfaceQueryFuture<T>
- Parameters:
listener
-
-