Class Node.CommandResult

java.lang.Object
com.scivicslab.turingworkflow.plugins.ssh.Node.CommandResult
Enclosing class:
Node

public static class Node.CommandResult extends Object
Represents the result of a command execution, containing stdout, stderr, and exit code.

Instances are immutable. Use isSuccess() to check if the command completed with exit code 0.

  • Constructor Details

    • CommandResult

      public CommandResult(String stdout, String stderr, int exitCode)
      Constructs a CommandResult with the given output and exit code.
      Parameters:
      stdout - the standard output from the command
      stderr - the standard error from the command
      exitCode - the exit code (0 for success)
  • Method Details

    • getStdout

      public String getStdout()
      Gets the standard output from the command.
      Returns:
      the stdout string
    • getStderr

      public String getStderr()
      Gets the standard error from the command.
      Returns:
      the stderr string
    • getExitCode

      public int getExitCode()
      Gets the exit code from the command.
      Returns:
      the exit code (0 typically indicates success)
    • isSuccess

      public boolean isSuccess()
      Checks whether the command completed successfully (exit code 0).
      Returns:
      true if the exit code is 0, false otherwise
    • toString

      public String toString()
      Returns a string representation of this command result.
      Overrides:
      toString in class Object
      Returns:
      a formatted string with exit code, stdout, and stderr