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 Details

    • handle

      Mono<Boolean> handle(C context, CommandResult result)
      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 to false.
      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

      default Mono<Boolean> apply(C context, CommandResult result)
      Specified by:
      apply in interface BiFunction<C extends @NonNull CommandContext,CommandResult,Mono<Boolean>>
      Implementation Requirements:
      Delegates to handle(CommandContext, CommandResult). Do not override.