public class CommandBuilder extends Object
Commands.| Constructor and Description |
|---|
CommandBuilder(CharSequence... command)
Creates a command builder with program name and parameters to be executed
|
CommandBuilder(CharSequence programName)
Creates a command builder with program name to be executed.
|
CommandBuilder(CommandBuilder builder)
Cloning constructor that creates a command builder based on this command builder.
|
| Modifier and Type | Method and Description |
|---|---|
Command |
build()
Builds so-far constructed command, any subsequent call of this method will build command starting from empty command
instance.
|
CommandBuilder |
parameter(CharSequence parameter)
Adds a parameter to the command under construction, ignoring null and empty parameter.
|
CommandBuilder |
parameters(CharSequence... parameters)
Adds parameters to the command under construction, ignoring null and empty parameters.
|
CommandBuilder |
parameters(List<? extends CharSequence> parameters)
Adds a list of parameters to the command under construction, ignoring null and empty parameters.
|
CommandBuilder |
splitToParameters(CharSequence sequenceToBeParsed) |
String |
toString() |
public CommandBuilder(CharSequence... command) throws IllegalArgumentException
command - Program name with subsequent parametersIllegalArgumentException - If command is an empty arraypublic CommandBuilder(CharSequence programName)
programName is a valid command for current operating systemprogramName - public CommandBuilder(CommandBuilder builder)
builder - the builder to be clonedIllegalArgumentException - if builder in nullpublic CommandBuilder parameters(List<? extends CharSequence> parameters)
parameters - parameters we are adding to the already existing listCommandBuilderpublic CommandBuilder parameters(CharSequence... parameters)
parameters - CommandBuilderpublic CommandBuilder parameter(CharSequence parameter)
parameter - parameter to add to the command listCommandBuilderpublic CommandBuilder splitToParameters(CharSequence sequenceToBeParsed)
stringToBeParsed - CommandBuilderpublic Command build()
Copyright © 2015 JBoss by Red Hat. All rights reserved.