Package dev.hypera.chameleon.scheduler
Interface Task
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Task
Task.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceTask.BuilderTask builder.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static @NotNull Taskasync(@NotNull Runnable runnable)Create a new asynchronous task.static @NotNull Task.Builderbuilder(@NotNull Runnable runnable)Create a new task builder.default booleanisAsync()Get whether this task should be executed asynchronously.voidrun()Execute this task.static @NotNull Tasksync(@NotNull Runnable runnable)Create a new synchronous task.
-
-
-
Method Detail
-
builder
@NotNull static @NotNull Task.Builder builder(@NotNull @NotNull Runnable runnable)
Create a new task builder.- Parameters:
runnable- Task runnable.- Returns:
- new builder.
-
sync
@NotNull static @NotNull Task sync(@NotNull @NotNull Runnable runnable)
Create a new synchronous task.- Parameters:
runnable- Task runnable.- Returns:
- new task.
-
async
@NotNull static @NotNull Task async(@NotNull @NotNull Runnable runnable)
Create a new asynchronous task.- Parameters:
runnable- Task runnable.- Returns:
- new task.
-
run
void run()
Execute this task.
-
isAsync
default boolean isAsync()
Get whether this task should be executed asynchronously.- Returns:
- asynchronous execution.
-
-