Class TaskGroup

java.lang.Object
dev.deepcore.challenge.session.TaskGroup

public final class TaskGroup extends Object
Tracks named tasks and guarantees replace/cancel behavior from one place.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancels and removes the task currently mapped to the provided key.
    void
    Cancels all tracked tasks and clears the task map.
    void
    replace(String key, org.bukkit.scheduler.BukkitTask task)
    Replaces any existing task for the key with the provided task instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TaskGroup

      public TaskGroup()
  • Method Details

    • replace

      public void replace(String key, org.bukkit.scheduler.BukkitTask task)
      Replaces any existing task for the key with the provided task instance.
      Parameters:
      key - logical task key
      task - task instance to store and manage
    • cancel

      public void cancel(String key)
      Cancels and removes the task currently mapped to the provided key.
      Parameters:
      key - logical task key to cancel
    • cancelAll

      public void cancelAll()
      Cancels all tracked tasks and clears the task map.