Class ConfigBoundCooldownState

java.lang.Object
com.ultikits.ultitools.abstracts.command.ConfigBoundCooldownState

@Internal public final class ConfigBoundCooldownState extends Object
Framework-internal access to the config-bound @CmdCD state an executor carries (#531): the resolved seconds of its bound cooldowns and their load-time value sources, both keyed by CooldownValidator.bindingKey. The state lives on the BaseCommandExecutor itself, the exact owner of a binding, so it lives and dies with the executor; a CooldownValidator shared by several executors holds none of it. This class exists so that the state needs no public method on BaseCommandExecutor, the class module authors extend.

Module code has no reason to use it.

Since:
6.3.0
  • Constructor Details

    • ConfigBoundCooldownState

      private ConfigBoundCooldownState()
  • Method Details

    • seconds

      public static Map<String,Integer> seconds(BaseCommandExecutor executor)
      Parameters:
      executor - an executor
      Returns:
      its resolved bound-cooldown seconds; never null
    • setSeconds

      public static void setSeconds(BaseCommandExecutor executor, Map<String,Integer> seconds)
      Replaces executor's resolved bound-cooldown seconds. A cooldown that is already running keeps the end time it was stamped with.
      Parameters:
      executor - an executor
      seconds - resolved seconds keyed by binding key
    • sources

      public static Map<String,Supplier<Long>> sources(BaseCommandExecutor executor)
      Parameters:
      executor - an executor
      Returns:
      its bound-cooldown value sources; never null
    • setSources

      public static void setSources(BaseCommandExecutor executor, Map<String,Supplier<Long>> sources)
      Replaces executor's bound-cooldown value sources.
      Parameters:
      executor - an executor
      sources - value sources keyed by binding key