Class Node.CommandResult
java.lang.Object
com.scivicslab.turingworkflow.plugins.ssh.Node.CommandResult
- Enclosing class:
Node
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 Summary
ConstructorsConstructorDescriptionCommandResult(String stdout, String stderr, int exitCode) Constructs a CommandResult with the given output and exit code. -
Method Summary
Modifier and TypeMethodDescriptionintGets the exit code from the command.Gets the standard error from the command.Gets the standard output from the command.booleanChecks whether the command completed successfully (exit code 0).toString()Returns a string representation of this command result.
-
Constructor Details
-
CommandResult
Constructs a CommandResult with the given output and exit code.- Parameters:
stdout- the standard output from the commandstderr- the standard error from the commandexitCode- the exit code (0 for success)
-
-
Method Details
-
getStdout
Gets the standard output from the command.- Returns:
- the stdout 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:
trueif the exit code is 0,falseotherwise
-
toString
Returns a string representation of this command result.
-