Interface CommandHandlingResult

All Known Implementing Classes:
CommandHandlingResult.DefaultHandlingResult

public interface CommandHandlingResult
Holder for handling some processing, typically with CommandExceptionResolver.
  • Method Details

    • message

      @Nullable String message()
      Gets a message for this CommandHandlingResult.
      Returns:
      a message
    • exitCode

      Integer exitCode()
      Gets an exit code for this CommandHandlingResult. Exit code only has meaning if shell is in non-interactive mode.
      Returns:
      an exit code
    • isPresent

      boolean isPresent()
      Indicate whether this CommandHandlingResult has a result.
      Returns:
      true if result exist
    • isEmpty

      boolean isEmpty()
      Indicate whether this CommandHandlingResult does not have a result.
      Returns:
      true if result doesn't exist
    • empty

      static CommandHandlingResult empty()
      Gets an empty instance of CommandHandlingResult.
      Returns:
      empty instance of CommandHandlingResult
    • of

      static CommandHandlingResult of(@Nullable String message)
      Gets an instance of CommandHandlingResult.
      Parameters:
      message - the message
      Returns:
      instance of CommandHandlingResult
    • of

      static CommandHandlingResult of(@Nullable String message, Integer exitCode)
      Gets an instance of CommandHandlingResult.
      Parameters:
      message - the message
      exitCode - the exit code
      Returns:
      instance of CommandHandlingResult