public abstract class CommandBuilder extends Object implements Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
CommandBuilder()
Create a new command builder.
|
protected |
CommandBuilder(String executable)
Create a new command builder with the specified executable.
|
| Modifier and Type | Method and Description |
|---|---|
CommandBuilder |
add(Iterable<String> arguments)
Add one or more arguments to the list of command arguments for this command builder.
|
CommandBuilder |
add(String... arguments)
Add one or more arguments to the list of command arguments for this command builder.
|
CommandBuilder |
addArgument(String argument)
Add an argument to the list of command arguments for this command builder.
|
CommandBuilder |
addArguments(Iterable<String> arguments)
Add one or more arguments to the list of command arguments for this command builder.
|
CommandBuilder |
addArguments(String... arguments)
Add one or more arguments to the list of command arguments for this command builder.
|
CommandBuilder |
addEnvironment(Map<String,String> environment)
Add environment variables to the map of environment variables for this command builder.
|
CommandBuilder |
addEnvironment(String variable,
String value)
Add an environment variable to the map of environment variables for this command builder.
|
CommandBuilder |
addFile(String file)
Add a file to the list of files to make available locally for this command builder.
|
CommandBuilder |
addFiles(Iterable<String> files)
Add files to the list of files to make available locally for this command builder.
|
CommandBuilder |
addFiles(String... files)
Add zero or more files to the list of files to make available locally for this command builder.
|
CommandBuilder |
addMount(String mount)
Add the specified mount point to the map of mount points for this command builder.
|
CommandBuilder |
addMount(String source,
String target)
Add the specified mount point to the map of mount points for this command builder.
|
CommandBuilder |
addMounts(Map<String,String> mounts)
Add the specified mount points to the map of mount points for this command builder.
|
abstract List<String> |
build()
Build and return the command for this command builder as a list of strings.
|
List<String> |
getArguments()
Return an immutable list of command arguments for this command builder.
|
Map<String,String> |
getEnvironment()
Return an immutable map of environment variables for this command builder.
|
String |
getExecutable()
Return the executable for this command builder.
|
List<String> |
getFiles()
Return an immutable list of files to make available locally for this command builder.
|
Integer |
getFlankSize()
Return the number of bases to flank each command invocation by for this builder.
|
String |
getImage()
Return the image for this command builder.
|
Map<String,String> |
getMounts()
Return the map of mount points for this command builder.
|
Optional<Integer> |
getOptFlankSize()
Return the number of bases to flank each command invocation by for this builder, as an optional.
|
Optional<Long> |
getOptTimeout()
Return how long to let a single partition run for, in seconds, for this builder, as an optional.
|
boolean |
getSudo()
Return true to run via sudo for this command builder.
|
Long |
getTimeout()
Return how long to let a single partition run for, in seconds, for this builder.
|
boolean |
isSudo()
Return true to run via sudo for this command builder.
|
CommandBuilder |
reset()
Reset this command builder.
|
CommandBuilder |
setExecutable(String executable)
Set the executable for this command builder.
|
CommandBuilder |
setFlankSize(Integer flankSize)
Set the number of bases to flank each command invocation by for this builder.
|
CommandBuilder |
setImage(String image)
Set the image for this command builder.
|
CommandBuilder |
setSudo(boolean sudo)
Set to true to run via sudo for this command builder.
|
CommandBuilder |
setTimeout(Long timeout)
Set how long to let a single partition run for, in seconds, for this builder.
|
CommandBuilder |
setTimeout(long duration,
TimeUnit timeUnit)
Set how long to let a single partition run for, in the specified time unit, for this builder.
|
protected CommandBuilder()
protected CommandBuilder(String executable)
executable - executable, must not be nullpublic final CommandBuilder setExecutable(String executable)
executable - executable, must not be nullpublic final CommandBuilder setFlankSize(@Nullable Integer flankSize)
flankSize - number of bases to flank each command invocation bypublic final CommandBuilder setImage(String image)
image - image, must not be nullpublic final CommandBuilder setSudo(boolean sudo)
sudo - true to run via sudopublic final CommandBuilder setTimeout(@Nullable Long timeout)
timeout - how long to let a single partition run for, in secondspublic final CommandBuilder setTimeout(long duration, TimeUnit timeUnit)
duration - durationtimeUnit - time unit, must not be nullpublic final CommandBuilder add(String... arguments)
arguments - variable number of arguments to add, must not be nullpublic final CommandBuilder add(Iterable<String> arguments)
arguments - arguments to add, must not be nullpublic final CommandBuilder addArgument(String argument)
argument - argument to add, must not be nullpublic final CommandBuilder addArguments(String... arguments)
arguments - variable number of arguments to add, must not be nullpublic final CommandBuilder addArguments(Iterable<String> arguments)
arguments - arguments to add, must not be nullpublic final CommandBuilder addEnvironment(String variable, String value)
variable - environment variable to add, must not be nullvalue - environment variable value to add, must not be nullpublic final CommandBuilder addEnvironment(Map<String,String> environment)
environment - environment variables to add, must not be nullpublic final CommandBuilder addFile(String file)
file - file to add, must not be nullpublic final CommandBuilder addFiles(String... files)
files - variable number of files to add, must not be nullpublic final CommandBuilder addFiles(Iterable<String> files)
files - files to add, must not be nullpublic final CommandBuilder addMount(String mount)
mount - mount point source and target, must not be nullpublic final CommandBuilder addMount(String source, String target)
source - mount point source, must not be nulltarget - mount point target, must not be nullpublic final CommandBuilder addMounts(Map<String,String> mounts)
mounts - mount points to add, must not be nullpublic final String getExecutable()
public final Integer getFlankSize()
public final Optional<Integer> getOptFlankSize()
public final String getImage()
public final Long getTimeout()
public final Optional<Long> getOptTimeout()
public final boolean getSudo()
public final boolean isSudo()
public final List<String> getArguments()
public final Map<String,String> getEnvironment()
public final List<String> getFiles()
public final Map<String,String> getMounts()
public final CommandBuilder reset()
public abstract List<String> build()
IllegalStateException - if this builder is in an illegal state, e.g.
if required values are not setCopyright © 2017–2018. All rights reserved.