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 Command
hidden
(Class<? extends CommandLineUtility> implementation) Creates a hidden command with the given implementation.static Command
hidden
(String name, Class<? extends CommandLineUtility> implementation) Creates a hidden command with the given name and implementation.boolean
Returnstrue
if this command is visible to users;false
otherwise.static Command
of
(Class<? extends CommandLineUtility> implementation) Creates a command with the given implementation.static Command
of
(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()Returnstrue
if this command is visible to users;false
otherwise.- Returns:
true
if this command is visible to users;false
otherwise
-
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
-