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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ExecuteStreamHandlerError stream handler.private ThreadFactoryThread factory.private PathWorking directory path. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) TasThis()Returns this instance typed as the subclass typeT.get()Creates a new configured DefaultExecutor.(package private) ExecuteStreamHandler(package private) ThreadFactory(package private) PathsetExecuteStreamHandler(ExecuteStreamHandler executeStreamHandler) Sets the PumpStreamHandler.setThreadFactory(ThreadFactory threadFactory) Sets the ThreadFactory.setWorkingDirectory(File workingDirectory) Sets the working directory.setWorkingDirectory(Path workingDirectory) Sets the working directory.
-
Field Details
-
executeStreamHandler
Error stream handler. -
threadFactory
Thread factory. -
workingDirectory
Working directory path.
-
-
Constructor Details
-
Builder
public Builder()Constructs a new instance.
-
-
Method Details
-
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
Creates a new configured DefaultExecutor.- Specified by:
getin interfaceSupplier<T extends DefaultExecutor.Builder<T>>- Returns:
- a new configured DefaultExecutor.
-
getExecuteStreamHandler
ExecuteStreamHandler getExecuteStreamHandler() -
getThreadFactory
ThreadFactory getThreadFactory() -
getWorkingDirectoryPath
Path getWorkingDirectoryPath() -
setExecuteStreamHandler
Sets the PumpStreamHandler.- Parameters:
executeStreamHandler- the ExecuteStreamHandler, null resets to the default.- Returns:
thisinstance.
-
setThreadFactory
Sets the ThreadFactory.- Parameters:
threadFactory- the ThreadFactory, null resets to the default.- Returns:
thisinstance.
-
setWorkingDirectory
-
setWorkingDirectory
-