Interface ResultHandler<C extends @NonNull CommandContext>
- Type Parameters:
C
- The context type.
- All Superinterfaces:
BiFunction<C,
CommandResult, Mono<Boolean>>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface ResultHandler<C extends @NonNull CommandContext>
extends BiFunction<C,CommandResult,Mono<Boolean>>
A function that handles the result of a command.
- Since:
- 1.0
- Version:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionapply
(C context, CommandResult result) handle
(C context, CommandResult result) Handles the result of a command.Methods inherited from interface java.util.function.BiFunction
andThen
-
Method Details
-
handle
Handles the result of a command.- Parameters:
context
- The context of the command.result
- The result of the command.- Returns:
- A Mono that issues
true
if the result was fully handled and no longer needs to be processed,false
if the result should continue to be processed by subsequent handlers. The Mono may also be empty, in which case it is equivalent tofalse
. - API Note:
- Unlike an invocation handler, this handler is not free to throw any exceptions. This is due to the fact that no further handling will be done if a result handler encounters an error, other than logging the exception.
-
apply
- Specified by:
apply
in interfaceBiFunction<C extends @NonNull CommandContext,
CommandResult, Mono<Boolean>> - Implementation Requirements:
- Delegates to
handle(CommandContext, CommandResult)
. Do not override.
-