Package dev.polv.taleapi.command
Enum Class CommandResult
- All Implemented Interfaces:
Serializable,Comparable<CommandResult>,Constable
Represents the result of a command execution.
This enum indicates whether a command completed successfully, failed, or was not handled.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic CommandResultReturns the enum constant of this class with the specified name.static CommandResult[]values()Returns an array containing the constants of this enum class, in the order they are declared.boolean
-
Enum Constant Details
-
SUCCESS
The command executed successfully. -
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
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
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
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 nameNullPointerException- if the argument is null
-
wasHandled
public boolean wasHandled()- Returns:
trueif the command was handled (SUCCESS or FAILURE)
-
isSuccess
public boolean isSuccess()- Returns:
trueif the command executed successfully
-