Add TaskBuilder#build

This commit is contained in:
Matthew 2021-08-15 13:14:38 +02:00 committed by Matt Worzala
parent 2674ca933e
commit 1c92414cad

View File

@ -138,11 +138,28 @@ public class TaskBuilder {
}
/**
* Schedules this {@link Task} for execution.
* Builds a {@link Task}.
*
* @return the built {@link Task}
*/
@NotNull
public Task build() {
return new Task(
this.schedulerManager,
this.runnable,
this.shutdown,
this.delay,
this.repeat,
this.isTransient,
this.owningExtension);
}
/**
* Schedules this {@link Task} for execution.
*
* @return the scheduled {@link Task}
*/
@NotNull
public Task schedule() {
Task task = build();
if (this.shutdown) {