Package readycli
Class Option
java.lang.Object
readycli.Option
- All Implemented Interfaces:
- java.io.Serializable
public final class Option
extends java.lang.Object
implements java.io.Serializable
An option is an argument of a 
Command that can be optionally
 specified on command.line. An option is useful to change the default values
 of some parameters. These parameters, if present, succeed
 the option name on the command-line. An option with no parameters is called a
 flag. To create a new option, the create(String, String) method must
 be invoked.- Author:
- Salvatore Giampa'
- See Also:
- Serialized Form
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classOption.BuilderA builder entity used build newoptions.static classOption.ParameterRepresents a parameter of anOption.
- 
Method SummaryModifier and Type Method Description static Option.Buildercreate(java.lang.String name, java.lang.String description)Starts the creation of a new command-line option.java.util.List<java.lang.String>getAliases()Gets the list of the aliases of this option. the aliases are secondary or shortest names assigned to an option, to simplify its specification on command-line.java.lang.StringgetDescription()Gets the description of the option.java.lang.StringgetName()Gets the name of the option.java.util.List<Option.Parameter>getParameters()Gets the list of the option parameters, in the order they were specified during construction.
- 
Method Details- 
getNamepublic java.lang.String getName()Gets the name of the option.- Returns:
- the name of the option as a string
 
- 
getDescriptionpublic java.lang.String getDescription()Gets the description of the option.- Returns:
- the description of the option as a string
 
- 
getParametersGets the list of the option parameters, in the order they were specified during construction.- Returns:
- the list of parameters.
 
- 
getAliasespublic java.util.List<java.lang.String> getAliases()Gets the list of the aliases of this option. the aliases are secondary or shortest names assigned to an option, to simplify its specification on command-line.- Returns:
- the list of aliases assigned to this option
 
- 
createStarts the creation of a new command-line option. An option can be specified on the command-line by specifying its name preceded by two consecutive minus ("--") characters.
 
 An option can be accessed from theCommandContextonly through its name as it is specified during the construction of the option.- Parameters:
- name- the name of the option
- description- the description of the option
- Returns:
- An Option.Builderobject
 
 
-