Interface CooldownConfiguration<C>
- Type Parameters:
C- command sender type
- All Known Implementing Classes:
ImmutableCooldownConfiguration
Configuration for a
CooldownManager.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns the active cooldown listeners.static <C> @NonNull ImmutableCooldownConfiguration.RepositoryBuildStage<C>builder()Returns a new configuration builder.default @NonNull Predicate<@NonNull CommandContext<C>>Returns a predicate that determines whether theCommandContextshould bypass the cooldown requirement.clock()Returns the clock used to calculate the current time.Returns the creation listeners.Returns the function that determines the fallbackCooldownGroupin case no group has been provided to theCooldown.default @NonNull CooldownProfileFactoryReturns the factory that produces cooldown profiles.Returns the repository used to store cooldowns.
-
Method Details
-
builder
Returns a new configuration builder.- Type Parameters:
C- command sender type- Returns:
- the builder
-
repository
@NonNull CooldownRepository<C> repository()Returns the repository used to store cooldowns.- Returns:
- the repository
-
activeCooldownListeners
@NonNull List<CooldownActiveListener<C>> activeCooldownListeners()Returns the active cooldown listeners.The active cooldown listeners are invoked when a cooldown is preventing a sender from executing a command.
- Returns:
- active cooldown listeners
-
creationListeners
@NonNull List<CooldownCreationListener<C>> creationListeners()Returns the creation listeners.The creation listeners are invoked when a new cooldown is created.
- Returns:
- creation listeners
-
bypassCooldown
Returns a predicate that determines whether theCommandContextshould bypass the cooldown requirement.The default implementation always returns
false- Returns:
- predicate that determines whether cooldowns should be skipped
-
clock
Returns the clock used to calculate the current time.- Returns:
- the clock
-
profileFactory
Returns the factory that produces cooldown profiles.- Returns:
- cooldown profile factory
-
fallbackGroup
Returns the function that determines the fallbackCooldownGroupin case no group has been provided to theCooldown.- Returns:
- the fallback group function
-