org.opends.server.util.cli
Class CommandBuilder

java.lang.Object
  extended by org.opends.server.util.cli.CommandBuilder

public class CommandBuilder
extends java.lang.Object

Class used to be able to generate the non interactive mode.


Constructor Summary
CommandBuilder(java.lang.String commandName)
          The constructor for the CommandBuilder.
CommandBuilder(java.lang.String commandName, java.lang.String subcommandName)
          The constructor for the CommandBuilder.
 
Method Summary
 void addArgument(Argument argument)
          Adds an argument to the list of the command builder.
 void addObfuscatedArgument(Argument argument)
          Adds an argument whose values must be obfuscated (passwords for instance).
 void append(CommandBuilder builder)
          Appends the arguments of another command builder to this command builder.
 void clearArguments()
          Clears the arguments.
 java.util.List<Argument> getArguments()
          Returns the list of arguments.
 boolean removeArgument(Argument argument)
          Removes the provided argument from this CommandBuilder.
 java.lang.String toString()
          Returns the String representation of this command builder (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandBuilder

public CommandBuilder(java.lang.String commandName)
The constructor for the CommandBuilder.

Parameters:
commandName - the command name.

CommandBuilder

public CommandBuilder(java.lang.String commandName,
                      java.lang.String subcommandName)
The constructor for the CommandBuilder.

Parameters:
commandName - the command name.
subcommandName - the subcommand name.
Method Detail

addArgument

public void addArgument(Argument argument)
Adds an argument to the list of the command builder.

Parameters:
argument - the argument to be added.

addObfuscatedArgument

public void addObfuscatedArgument(Argument argument)
Adds an argument whose values must be obfuscated (passwords for instance).

Parameters:
argument - the argument to be added.

removeArgument

public boolean removeArgument(Argument argument)
Removes the provided argument from this CommandBuilder.

Parameters:
argument - the argument to be removed.
Returns:
true if the attribute was present and removed and false otherwise.

append

public void append(CommandBuilder builder)
Appends the arguments of another command builder to this command builder.

Parameters:
builder - the CommandBuilder to append.

toString

public java.lang.String toString()
Returns the String representation of this command builder (i.e. what we want to show to the user).

Overrides:
toString in class java.lang.Object
Returns:
the String representation of this command builder (i.e. what we want to show to the user).

clearArguments

public void clearArguments()
Clears the arguments.


getArguments

public java.util.List<Argument> getArguments()
Returns the list of arguments.

Returns:
the list of arguments.