Record Class SshCommandResult
java.lang.Object
java.lang.Record
com.shaft.cli.SshCommandResult
- Record Components:
command- the exact command text that was executedstdout- standard output captured from the remote commandstderr- standard error captured from the remote commandexitCode- remote process exit codedurationMillis- elapsed execution time in milliseconds
public record SshCommandResult(String command, String stdout, String stderr, int exitCode, long durationMillis)
extends Record
Structured result of a remote SSH command executed through
TerminalActions.-
Constructor Summary
ConstructorsConstructorDescriptionSshCommandResult(String command, String stdout, String stderr, int exitCode, long durationMillis) Creates an immutable SSH command result with non-null stream values. -
Method Summary
Modifier and TypeMethodDescriptioncommand()Returns the value of thecommandrecord component.longReturns the value of thedurationMillisrecord component.final booleanIndicates whether some other object is "equal to" this one.intexitCode()Returns the value of theexitCoderecord component.final inthashCode()Returns a hash code value for this object.stderr()Returns the value of thestderrrecord component.stdout()Returns the value of thestdoutrecord component.booleanfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SshCommandResult
-
-
Method Details
-
succeeded
public boolean succeeded()- Returns:
truewhen the remote command exited with code0
-
combinedOutput
- Returns:
- stdout and stderr merged in execution order for callers that expect one combined log
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
command
-
stdout
-
stderr
-
exitCode
-
durationMillis
public long durationMillis()Returns the value of thedurationMillisrecord component.- Returns:
- the value of the
durationMillisrecord component
-