Class CommandResult

java.lang.Object
me.internalizable.numdrassl.api.command.CommandResult

public final class CommandResult extends Object
Represents the result of a command execution.
  • Method Details

    • getStatus

      @Nonnull public CommandResult.Status getStatus()
      Get the status of this result.
      Returns:
      the status
    • getMessage

      @Nullable public String getMessage()
      Get the message associated with this result.
      Returns:
      the message, or null
    • isSuccess

      public boolean isSuccess()
      Check if the command was successful.
      Returns:
      true if successful
    • success

      public static CommandResult success()
      A successful command result.
      Returns:
      success result
    • success

      public static CommandResult success(@Nonnull String message)
      A successful command result with a message.
      Parameters:
      message - the success message
      Returns:
      success result
    • failure

      public static CommandResult failure()
      A failed command result.
      Returns:
      failure result
    • failure

      public static CommandResult failure(@Nonnull String message)
      A failed command result with a message.
      Parameters:
      message - the error message
      Returns:
      failure result
    • notFound

      public static CommandResult notFound()
      A result indicating the command was not found.
      Returns:
      not found result
    • noPermission

      public static CommandResult noPermission()
      A result indicating insufficient permissions.
      Returns:
      no permission result