Interface ConfirmationConfiguration<C>
- Type Parameters:
C- command sender type
- All Known Implementing Classes:
ImmutableConfirmationConfiguration
Configuration for a
ConfirmationManager.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull ImmutableConfirmationConfiguration.CacheBuildStage<C>builder()Returns a new configuration builder.default @NonNull Predicate<@NonNull CommandContext<C>>Returns a predicate that determines whether theCommandContextshould bypass the confirmation requirement.cache()Returns the cache used to store pending commands.Returns a consumer that gets invoked when a command requires confirmation.Returns the time to keep the pending commands for.Returns a consumer that gets invoked when a sender tries to invoke the confirmation handler without having any pending commands.
-
Method Details
-
builder
Returns a new configuration builder.- Type Parameters:
C- command sender type- Returns:
- the builder
-
cache
@NonNull CloudCache<C,ConfirmationContext<C>> cache()Returns the cache used to store pending commands.- Returns:
- the cache
-
noPendingCommandNotifier
Returns a consumer that gets invoked when a sender tries to invoke the confirmation handler without having any pending commands.- Returns:
- notifier for no pending commands
-
confirmationRequiredNotifier
@NonNull BiConsumer<C,ConfirmationContext<C>> confirmationRequiredNotifier()Returns a consumer that gets invoked when a command requires confirmation.- Returns:
- notifier for commands that require confirmation
-
bypassConfirmation
Returns a predicate that determines whether theCommandContextshould bypass the confirmation requirement.The default implementation always returns
false- Returns:
- predicate that determines whether confirmation should be skipped
-
expiration
Returns the time to keep the pending commands for. This can be set tonullto not enforce an expiration time.It is recommended to configure the
cache()to match this value.The default value is
null.- Returns:
- the expiration duration
-