Enum Class CommandResult

java.lang.Object
java.lang.Enum<CommandResult>
dev.polv.taleapi.command.CommandResult
All Implemented Interfaces:
Serializable, Comparable<CommandResult>, Constable

public enum CommandResult extends Enum<CommandResult>
Represents the result of a command execution.

This enum indicates whether a command completed successfully, failed, or was not handled.

  • Enum Constant Details

    • SUCCESS

      public static final CommandResult SUCCESS
      The command executed successfully.
    • FAILURE

      public static final CommandResult FAILURE
      The command failed to execute.

      This typically indicates a logical failure (e.g., player not found, invalid state) rather than a syntax error.

    • PASS

      public static final CommandResult PASS
      The command was not handled.

      This can be used when a command executor decides not to handle the command and wants to pass it to the next handler.

  • Method Details

    • values

      public static CommandResult[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CommandResult valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • wasHandled

      public boolean wasHandled()
      Returns:
      true if the command was handled (SUCCESS or FAILURE)
    • isSuccess

      public boolean isSuccess()
      Returns:
      true if the command executed successfully