Interface TaskBuilder


public interface TaskBuilder
Builder for configuring and scheduling tasks.
  • Method Details

    • delay

      @Nonnull TaskBuilder delay(long delay, @Nonnull TimeUnit unit)
      Set the delay before the task runs.
      Parameters:
      delay - the delay
      unit - the time unit
      Returns:
      this builder
    • repeat

      @Nonnull TaskBuilder repeat(long period, @Nonnull TimeUnit unit)
      Set the task to repeat at a fixed rate.
      Parameters:
      period - the period between runs
      unit - the time unit
      Returns:
      this builder
    • clearRepeat

      @Nonnull TaskBuilder clearRepeat()
      Clear any scheduled repeat for this task.
      Returns:
      this builder
    • schedule

      @Nonnull ScheduledTask schedule()
      Schedule the task.
      Returns:
      the scheduled task