Class CommandBuilder
- java.lang.Object
-
- com.thebuzzmedia.exiftool.process.command.CommandBuilder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CommandBuilder
addAll(Iterable<String> arguments)
Add all arguments to the command line.CommandBuilder
addArgument(String arg, String... args)
Add new argument to the command line.Command
build()
Build the command line.static CommandBuilder
builder(String executable)
Get new builder.static CommandBuilder
builder(String executable, int nbArgs)
Get new builder.
-
-
-
Method Detail
-
builder
public static CommandBuilder builder(String executable)
Get new builder.
Note: Usebuilder(String, int)
to optimize the creation of the argument list.- Parameters:
executable
- Executable value.- Returns:
- The new builder.
- Throws:
NullPointerException
- If executable is null.IllegalArgumentException
- If executable is empty or blank.
-
builder
public static CommandBuilder builder(String executable, int nbArgs)
Get new builder.- Parameters:
executable
- Executable value.nbArgs
- The expected number of arguments.- Returns:
- The new builder.
- Throws:
NullPointerException
- If executable is null.IllegalArgumentException
- If executable is empty or blank.
-
addArgument
public CommandBuilder addArgument(String arg, String... args)
Add new argument to the command line.- Parameters:
arg
- First argument.args
- Next optional arguments.- Returns:
- The builder.
- Throws:
NullPointerException
- If one of the arguments isnull
.IllegalArgumentException
- If one of the arguments is empty or blank.
-
addAll
public CommandBuilder addAll(Iterable<String> arguments)
Add all arguments to the command line.- Parameters:
arguments
- All arguments.- Returns:
- The builder.
- Throws:
NullPointerException
- If arguments isnull
.IllegalArgumentException
- If arguments is empty.
-
build
public Command build()
Build the command line.- Returns:
- Command Line instance.
-
-