Interface CommandCondition


public interface CommandCondition
Represents a condition that must be met in order for the command invocation to continue.

These conditions can test against custom annotations in ExecutableCommands, and hence perform external checks for reducing boilerplate

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    test(@NotNull CommandActor actor, @NotNull ExecutableCommand command, @NotNull @Unmodifiable List<String> arguments)
    Evaluates the condition.
  • Method Details

    • test

      void test(@NotNull @NotNull CommandActor actor, @NotNull @NotNull ExecutableCommand command, @NotNull @NotNull @Unmodifiable List<String> arguments)
      Evaluates the condition.

      Ideally, this should throw any exceptions if the condition fails, and lets them get handled by the CommandExceptionHandler.

      Parameters:
      actor - The command actor
      command - The invoked command
      arguments - An immutable view of command arguments