Package: org.codehaus.groovy.runtime

## [Java] Class ProcessResult

- 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

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ProcessResult(String out, String err, int exitCode)` Constructs a ProcessResult with the specified output, error, and exit code.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public String` | `getErr()` Returns the standard error of the process as a String.
    `` | `public int` | `getExitCode()` Returns the exit code of the process.
    `` | `public String` | `getOut()` Returns the standard output of the process as a String.
    `` | `public boolean` | `isOk()` Returns `true` if the process exited with code 0.
    `` | `public String` | `toString()` Returns a string representation of this process result, including the exit code and abbreviated output/error.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

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

      Constructs a ProcessResult with the specified output, error, and exit code.

      Parameters:
        `out` - the standard output of the process
        `err` - the standard error of the process
        `exitCode` - the process exit code

  - ### Method Detail

    - #### public String getErr()

      Returns the standard error of the process as a String.

    - #### public int getExitCode()

      Returns the exit code of the process.

    - #### public String getOut()

      Returns the standard output of the process as a String.

    - #### public boolean isOk()

      Returns `true` if the process exited with code 0.

    - #### public String toString()

      Returns a string representation of this process result, including the exit code and abbreviated output/error.