Class ProcessResult
java.lang.Object
org.kiwiproject.beta.base.process.ProcessResult
Represents the result of running a command line process. May include data written
to stdout or stderr. There will not be an exit code if the process timed out, nor
stdout or stderr. There may or may not be an error (represented as a Throwable).
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()getError()ReturnOptionalcontaining the error, or an empty Optional if the process succeeded.ReturnOptionalcontaining the process exit code, or an empty Optional if the process timed out.intbooleanhasError()Return true if this result contains an error.booleanReturn true if the exit code is NOT zero, and false for any other value.booleanReturn true if the exit code is zero, and false for any other value.static booleanisSuccessfulExitCode(int exitCode) Return true if the exit code is zero, and false for any other value.boolean
-
Method Details
-
isSuccessfulExitCode
public static boolean isSuccessfulExitCode(int exitCode) Return true if the exit code is zero, and false for any other value. -
getExitCode
ReturnOptionalcontaining the process exit code, or an empty Optional if the process timed out. -
isSuccessfulExit
public boolean isSuccessfulExit()Return true if the exit code is zero, and false for any other value. -
isNotSuccessfulExit
public boolean isNotSuccessfulExit()Return true if the exit code is NOT zero, and false for any other value. -
hasError
public boolean hasError()Return true if this result contains an error. -
getError
ReturnOptionalcontaining the error, or an empty Optional if the process succeeded. -
builder
-
getStdOutLines
-
getStdErrLines
-
isTimedOut
public boolean isTimedOut() -
getTimeoutThresholdMillis
public int getTimeoutThresholdMillis()
-