Package dev.hypera.chameleon.scheduler
Interface Task.Builder
-
- Enclosing interface:
- Task
@NonExtendable public static interface Task.BuilderTask builder.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull Task.Builderasync()Execute this task asynchronously.@NotNull Taskbuild()Build task.@NotNull Task.BuildercancelAfter(int cancelAfter)Cancel aftercancelAfterexecutions.@NotNull Task.BuildercancelWhen(@NotNull BooleanSupplier cancelWhen)Cancel this task when this the supplier returnstrue.@NotNull Task.Builderdelay(@NotNull Schedule delay)Execute this task after a delay.@NotNull Task.Builderrepeat(@NotNull Schedule repeat)Execute this task repeatedly.@NotNull Task.Buildersync()Execute this task synchronously.
-
-
-
Method Detail
-
sync
@Contract("-> this") @NotNull @NotNull Task.Builder sync()Execute this task synchronously.- Returns:
this.
-
async
@Contract("-> this") @NotNull @NotNull Task.Builder async()Execute this task asynchronously.- Returns:
this.
-
delay
@Contract("_ -> this") @NotNull @NotNull Task.Builder delay(@NotNull @NotNull Schedule delay)Execute this task after a delay.- Parameters:
delay- Delay schedule.- Returns:
this.
-
repeat
@Contract("_ -> this") @NotNull @NotNull Task.Builder repeat(@NotNull @NotNull Schedule repeat)Execute this task repeatedly.- Parameters:
repeat- Repeat schedule.- Returns:
this.
-
cancelWhen
@Contract("_ -> this") @NotNull @NotNull Task.Builder cancelWhen(@NotNull @NotNull BooleanSupplier cancelWhen)Cancel this task when this the supplier returnstrue.- Parameters:
cancelWhen- Cancel when.- Returns:
this.
-
cancelAfter
@Contract("_ -> this") @NotNull @NotNull Task.Builder cancelAfter(int cancelAfter)Cancel aftercancelAfterexecutions.- Parameters:
cancelAfter- Cancel after.- Returns:
this.
-
build
@Contract(value="-> new", pure=true) @NotNull @NotNull Task build()Build task.- Returns:
- new task.
-
-