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:
java.util.function.Supplier<DefaultExecutor>
- Direct Known Subclasses:
DaemonExecutor.Builder
- Enclosing class:
- DefaultExecutor
public static class DefaultExecutor.Builder<T extends DefaultExecutor.Builder<T>> extends java.lang.Object implements java.util.function.Supplier<DefaultExecutor>
Constructs a newDefaultExecutor.- Since:
- 1.4.0
-
-
Field Summary
Fields Modifier and Type Field Description private ExecuteStreamHandlerexecuteStreamHandlerError stream handler.private java.util.concurrent.ThreadFactorythreadFactoryThread factory.private java.nio.file.PathworkingDirectoryWorking directory path.
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) TasThis()Returns this instance typed as the subclass typeT.DefaultExecutorget()Creates a new configured DefaultExecutor.(package private) ExecuteStreamHandlergetExecuteStreamHandler()(package private) java.util.concurrent.ThreadFactorygetThreadFactory()(package private) java.nio.file.PathgetWorkingDirectoryPath()TsetExecuteStreamHandler(ExecuteStreamHandler executeStreamHandler)Sets the PumpStreamHandler.TsetThreadFactory(java.util.concurrent.ThreadFactory threadFactory)Sets the ThreadFactory.TsetWorkingDirectory(java.io.File workingDirectory)Sets the working directory.TsetWorkingDirectory(java.nio.file.Path workingDirectory)Sets the working directory.
-
-
-
Field Detail
-
executeStreamHandler
private ExecuteStreamHandler executeStreamHandler
Error stream handler.
-
threadFactory
private java.util.concurrent.ThreadFactory threadFactory
Thread factory.
-
workingDirectory
private java.nio.file.Path workingDirectory
Working directory path.
-
-
Method Detail
-
asThis
T asThis()
Returns this instance typed as the subclass typeT.This is the same as the expression:
(B) this
- Returns:
thisinstance typed as the subclass typeT.
-
get
public DefaultExecutor get()
Creates a new configured DefaultExecutor.- Specified by:
getin interfacejava.util.function.Supplier<T extends DefaultExecutor.Builder<T>>- Returns:
- a new configured DefaultExecutor.
-
getExecuteStreamHandler
ExecuteStreamHandler getExecuteStreamHandler()
-
getThreadFactory
java.util.concurrent.ThreadFactory getThreadFactory()
-
getWorkingDirectoryPath
java.nio.file.Path getWorkingDirectoryPath()
-
setExecuteStreamHandler
public T setExecuteStreamHandler(ExecuteStreamHandler executeStreamHandler)
Sets the PumpStreamHandler.- Parameters:
executeStreamHandler- the ExecuteStreamHandler, null resets to the default.- Returns:
thisinstance.
-
setThreadFactory
public T setThreadFactory(java.util.concurrent.ThreadFactory threadFactory)
Sets the ThreadFactory.- Parameters:
threadFactory- the ThreadFactory, null resets to the default.- Returns:
thisinstance.
-
setWorkingDirectory
public T setWorkingDirectory(java.io.File workingDirectory)
Sets the working directory.- Parameters:
workingDirectory- the working directory., null resets to the default.- Returns:
thisinstance.
-
setWorkingDirectory
public T setWorkingDirectory(java.nio.file.Path workingDirectory)
Sets the working directory.- Parameters:
workingDirectory- the working directory., null resets to the default.- Returns:
thisinstance.- Since:
- 1.5.0
-
-