Package com.suse.common.io.process
Record Class ProcessOutput
java.lang.Object
java.lang.Record
com.suse.common.io.process.ProcessOutput
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProcessOutput(int exitCode, String standardOutput, String standardError) Creates an instance of aProcessOutputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intexitCode()Returns the value of theexitCoderecord component.booleanfailed()Checks if process output is failedRetrieves the error message, if anyfinal inthashCode()Returns a hash code value for this object.booleanChecks if there is a meaningful standard errorbooleanChecks if there is a meaningful standard outputReturns the value of thestandardErrorrecord component.Returns the value of thestandardOutputrecord component.booleanChecks if process output is succeededfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
exitCode
private final int exitCodeThe field for theexitCoderecord component. -
standardOutput
The field for thestandardOutputrecord component. -
standardError
The field for thestandardErrorrecord component.
-
-
Constructor Details
-
ProcessOutput
Creates an instance of aProcessOutputrecord class.- Parameters:
exitCode- the value for theexitCoderecord componentstandardOutput- the value for thestandardOutputrecord componentstandardError- the value for thestandardErrorrecord component
-
-
Method Details
-
succeeded
public boolean succeeded()Checks if process output is succeeded- Returns:
- true if process output is succeeded
-
failed
public boolean failed()Checks if process output is failed- Returns:
- true if process output is failed
-
getErrorMessage
Retrieves the error message, if any- Returns:
- the error message
-
hasStandardOutput
public boolean hasStandardOutput()Checks if there is a meaningful standard output- Returns:
- true if there is a meaningful standard output
-
hasStandardError
public boolean hasStandardError()Checks if there is a meaningful standard error- Returns:
- true if there is a meaningful standard error
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
exitCode
public int exitCode()Returns the value of theexitCoderecord component.- Returns:
- the value of the
exitCoderecord component
-
standardOutput
Returns the value of thestandardOutputrecord component.- Returns:
- the value of the
standardOutputrecord component
-
standardError
Returns the value of thestandardErrorrecord component.- Returns:
- the value of the
standardErrorrecord component
-