public class CommandBuilder
extends java.lang.Object
Command
.Modifier and Type | Method and Description |
---|---|
CommandBuilder |
addAll(java.lang.Iterable<java.lang.String> arguments)
Add all arguments to the command line.
|
CommandBuilder |
addArgument(java.lang.String arg,
java.lang.String... args)
Add new argument to the command line.
|
Command |
build()
Build the command line.
|
static CommandBuilder |
builder(java.lang.String executable)
Get new builder.
|
static CommandBuilder |
builder(java.lang.String executable,
int nbArgs)
Get new builder.
|
public static CommandBuilder builder(java.lang.String executable)
builder(String, int)
to optimize the creation of the argument list.executable
- Executable value.java.lang.NullPointerException
- If executable is null.java.lang.IllegalArgumentException
- If executable is empty or blank.public static CommandBuilder builder(java.lang.String executable, int nbArgs)
executable
- Executable value.nbArgs
- The expected number of arguments.java.lang.NullPointerException
- If executable is null.java.lang.IllegalArgumentException
- If executable is empty or blank.public CommandBuilder addArgument(java.lang.String arg, java.lang.String... args)
arg
- First argument.args
- Next optional arguments.java.lang.NullPointerException
- If one of the arguments is null
.java.lang.IllegalArgumentException
- If one of the arguments is empty or blank.public CommandBuilder addAll(java.lang.Iterable<java.lang.String> arguments)
arguments
- All arguments.java.lang.NullPointerException
- If arguments is null
.java.lang.IllegalArgumentException
- If arguments is empty.public Command build()
Copyright © 2019. All Rights Reserved.