Package org.apache.commons.exec

# Class DefaultExecutor.Builder<T extends DefaultExecutor.Builder<T>>

java.lang.Object
org.apache.commons.exec.DefaultExecutor.Builder<T>

Type Parameters:
  `T` - The builder type.

All Implemented Interfaces:
  `Supplier<DefaultExecutor>`

Direct Known Subclasses:
  `DaemonExecutor.Builder`

Enclosing class:
  DefaultExecutor

public static class DefaultExecutor.Builder<T extends DefaultExecutor.Builder<T>> extends Object implements Supplier<DefaultExecutor>
Constructs a new `DefaultExecutor`.

Since:
  1.4.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DefaultExecutor`
  `get()`
  Creates a new configured DefaultExecutor.
  `T`
  `setExecuteStreamHandler(ExecuteStreamHandler executeStreamHandler)`
  Sets the PumpStreamHandler.
  `T`
  `setThreadFactory(ThreadFactory threadFactory)`
  Sets the ThreadFactory.
  `T`
  `setWorkingDirectory(File workingDirectory)`
  Sets the working directory.
  `T`
  `setWorkingDirectory(Path workingDirectory)`
  Sets the working directory.

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

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

- ## Constructor Details

  - ### Builder

    public Builder()
    Constructs a new instance.

- ## Method Details

  - ### get

    public DefaultExecutor get()
    Creates a new configured DefaultExecutor.
    Specified by:
      `get` in interface `Supplier<T extends DefaultExecutor.Builder<T>>`
    Returns:
      a new configured DefaultExecutor.

  - ### setExecuteStreamHandler

    public T setExecuteStreamHandler(ExecuteStreamHandler executeStreamHandler)
    Sets the PumpStreamHandler.
    Parameters:
      `executeStreamHandler` - the ExecuteStreamHandler, null resets to the default.
    Returns:
      `this` instance.

  - ### setThreadFactory

    public T setThreadFactory(ThreadFactory threadFactory)
    Sets the ThreadFactory.
    Parameters:
      `threadFactory` - the ThreadFactory, null resets to the default.
    Returns:
      `this` instance.

  - ### setWorkingDirectory

    public T setWorkingDirectory(File workingDirectory)
    Sets the working directory.
    Parameters:
      `workingDirectory` - the working directory., null resets to the default.
    Returns:
      `this` instance.

  - ### setWorkingDirectory

    public T setWorkingDirectory(Path workingDirectory)
    Sets the working directory.
    Parameters:
      `workingDirectory` - the working directory., null resets to the default.
    Returns:
      `this` instance.
    Since:
      1.5.0