Package org.moeaframework.util.cli
Class Command
java.lang.Object
org.moeaframework.util.cli.Command
Defines a command for use by a command line utility. CLIs designed around commands require one position argument,
the command name to invoke.
-
Method Summary
Modifier and TypeMethodDescriptionClass<? extends CommandLineUtility>Returns the class implementing this command.getName()Returns the display name for this command.static Commandhidden(Class<? extends CommandLineUtility> implementation) Creates a hidden command with the given implementation.static Commandhidden(String name, Class<? extends CommandLineUtility> implementation) Creates a hidden command with the given name and implementation.booleanReturnstrueif this command is visible to users;falseotherwise.static Commandof(Class<? extends CommandLineUtility> implementation) Creates a command with the given implementation.static Commandof(String name, Class<? extends CommandLineUtility> implementation) Creates a command with the given name and implementation.
-
Method Details
-
getName
Returns the display name for this command.- Returns:
- the display name
-
getImplementation
Returns the class implementing this command.- Returns:
- the class
-
isVisible
public boolean isVisible()Returnstrueif this command is visible to users;falseotherwise.- Returns:
trueif this command is visible to users;falseotherwise
-
of
Creates a command with the given implementation. The command name is derived from the class name.- Parameters:
implementation- the command implementation- Returns:
- the command
-
of
Creates a command with the given name and implementation.- Parameters:
name- the name of the commandimplementation- the command implementation- Returns:
- the command
-