Interface CommandResult.Builder

All Superinterfaces:
AbstractBuilder<CommandResult>, Builder<CommandResult,CommandResult.Builder>, ResettableBuilder<CommandResult,CommandResult.Builder>
Enclosing interface:
CommandResult

public static interface CommandResult.Builder extends Builder<CommandResult,CommandResult.Builder>
Builds CommandResults.
  • Method Details

    • result

      CommandResult.Builder result(int result)
      Sets an integer value that indicates the states of the command.
      • A positive value indicates successful execution,
      • Zero (generally) indicates the command didn't fulfil its task, though that is not necessarily an error condition.
      • A negative value is undefined in the API, if returned, the effects are implementation specific.
      Parameters:
      result - The integer result to set
      Returns:
      This builder, for chaining
    • error

      CommandResult.Builder error(@Nullable Component errorMessage)
      Sets the built result to report an error, with an optional error message.

      If this is set, then the command parser will send this message to the command invoker. Otherwise, the parser will report an unknown exception.

      Parameters:
      errorMessage - The message to send to the user.
      Returns:
      This builder, for chaining
    • build

      CommandResult build()
      Builds the CommandResult.
      Specified by:
      build in interface AbstractBuilder<CommandResult>
      Returns:
      A CommandResult with the specified settings