Class ConfigBoundCooldownState
java.lang.Object
com.ultikits.ultitools.abstracts.command.ConfigBoundCooldownState
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionseconds(BaseCommandExecutor executor) static voidsetSeconds(BaseCommandExecutor executor, Map<String, Integer> seconds) Replacesexecutor's resolved bound-cooldown seconds.static voidsetSources(BaseCommandExecutor executor, Map<String, Supplier<Long>> sources) Replacesexecutor's bound-cooldown value sources.sources(BaseCommandExecutor executor)
-
Constructor Details
-
ConfigBoundCooldownState
private ConfigBoundCooldownState()
-
-
Method Details
-
seconds
- Parameters:
executor- an executor- Returns:
- its resolved bound-cooldown seconds; never
null
-
setSeconds
Replacesexecutor's resolved bound-cooldown seconds. A cooldown that is already running keeps the end time it was stamped with.- Parameters:
executor- an executorseconds- resolved seconds keyed by binding key
-
sources
- Parameters:
executor- an executor- Returns:
- its bound-cooldown value sources; never
null
-
setSources
Replacesexecutor's bound-cooldown value sources.- Parameters:
executor- an executorsources- value sources keyed by binding key
-