public interface TaskImplementation<T>
| Modifier and Type | Method and Description |
|---|---|
@NotNull java.util.concurrent.CompletableFuture<TaskImplementation<T>> |
asFuture()
Returns a CompletableFuture that will be completed when the task has finished executing.
|
void |
cancel()
Cancels this task.
|
T |
getCallback()
Returns the callback from this task's execution.
|
@NotNull org.bukkit.plugin.Plugin |
getOwningPlugin()
Returns the plugin that owns this task.
|
boolean |
isCancelled()
Returns whether the task has been cancelled.
|
boolean |
isRepeatingTask()
Returns whether the task is a repeating task.
|
boolean |
isRunning()
Returns whether the task is currently executing.
|
@NotNull @NotNull org.bukkit.plugin.Plugin getOwningPlugin()
void cancel()
boolean isCancelled()
boolean isRunning()
boolean isRepeatingTask()
@Nullable T getCallback()
If the task has not been completed yet, this method will always return null. To check if the
task has been completed, use asFuture().
@NotNull @NotNull java.util.concurrent.CompletableFuture<TaskImplementation<T>> asFuture()
The future may not be completed if the task is cancelled before it is run, or if an exception occurs during execution of the task.