Package org.codehaus.groovy.runtime

# Class ProcessResult

java.lang.Object
org.codehaus.groovy.runtime.ProcessResult

public class ProcessResult extends Object
Captures the result of executing an external process, including the standard output, standard error, and exit code.

     def result = "ls -la".execute().waitForResult()
     assert result.ok
     println result.out

Since:
  6.0.0
See Also:
  - `ProcessGroovyMethods.waitForResult(Process)`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ProcessResult(String out, String err, int exitCode)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getErr()`
  Returns the standard error of the process as a String.
  `int`
  `getExitCode()`
  Returns the exit code of the process.
  `String`
  `getOut()`
  Returns the standard output of the process as a String.
  `boolean`
  `isOk()`
  Returns `true` if the process exited with code 0.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ProcessResult

    public ProcessResult(String out, String err, int exitCode)

- ## Method Details

  - ### getOut

    public String getOut()
    Returns the standard output of the process as a String.

  - ### getErr

    public String getErr()
    Returns the standard error of the process as a String.

  - ### getExitCode

    public int getExitCode()
    Returns the exit code of the process.

  - ### isOk

    public boolean isOk()
    Returns `true` if the process exited with code 0.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`