Option for java specifying the type of
object received by the option. This allows converting the given raw value into the specified type.
| Modifier and Type | Field and Description |
|---|---|
| protected Converter | converter
the converter to create the value. |
| protected String | listSeparator
the split character used if the raw value needs to be parsed as a list. |
| protected boolean | parsedAsList
whether or not the raw value should be parsed as a list. |
| protected Class | type
The type of the option. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | TypedOption(TypedOption<T>
the copied option option)Creates an instance of |
| Modifier and Type | Method and Description |
|---|---|
| public TypedOption | addChoice(String
the choice choice)Overrides io. Adds a choice to the list of values accepted by this option. |
| public void | ensureValidity()
Overrides io. Checks whether or not the option is valid. |
| public Converter | |
| public String | |
| public Class | |
| public boolean | |
| public TypedOption | setArgName(String
the arg name, must not be argName)nullOverrides io. Sets te arg name for this option. |
| public TypedOption | setChoices(Set<String>
the choices choices)Overrides io. Sets the list of values accepted by this option. |
| private void | |
| public TypedOption | |
| public TypedOption | setDefaultValue(String
the default value defaultValue)Overrides io. Sets the default value of this option |
| public TypedOption | setDescription(String
the description description)Overrides io. Sets te description of this option. |
| public TypedOption | setFlag(boolean
whether or not the option is a flag. flag)Overrides io. Configures the current |
| public TypedOption | setHidden(boolean
true to make this option hidden, false otherwiseOverrides io. Sets whether or not this option should be hidden |
| public TypedOption | |
| public TypedOption | setLongName(String
the long name longName)Overrides io. Sets the long name of this option. |
| public TypedOption | setMultiValued(boolean
whether or not this option is multi-valued. acceptMultipleValues)Overrides io. Sets whether or not this option can receive several values. |
| public TypedOption | |
| public TypedOption | setRequired(boolean
true to make this option mandatory, false otherwiseOverrides io. Sets whether or not this option is mandatory. |
| public TypedOption | setShortName(String
the short name shortName)Overrides io. Sets the short name of this option. |
| public TypedOption | setSingleValued(boolean
whether or not this option is single-valued. acceptSingleValue)Overrides io. Sets whether or not this option can receive a value. |
| public TypedOption |
| converter | back to summary |
|---|---|
| protected Converter<T> converter the converter to create the value. | |
| listSeparator | back to summary |
|---|---|
| protected String listSeparator the split character used if the raw value needs to be parsed as a list. | |
| parsedAsList | back to summary |
|---|---|
| protected boolean parsedAsList whether or not the raw value should be parsed as a list. The list if computed by splitting the value. | |
| type | back to summary |
|---|---|
| protected Class<T> type The type of the option. | |
| TypedOption | back to summary |
|---|---|
| public TypedOption() Creates an empty instance of | |
| TypedOption | back to summary |
|---|---|
| public TypedOption(TypedOption<T> option) Creates an instance of
| |
| addChoice | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Adds a choice to the list of values accepted by this option. If the value set by the user does not match once of these
values, a
| |
| ensureValidity | back to summary |
|---|---|
| public void ensureValidity() Overrides io. Doc from io. Checks whether or not the option is valid. This implementation check that it has a short name or a long name.
This method is intended to be extended by sub-class. Parser should check that the set of
option of a
If the configuration is not valid, this method throws a
| |
| getConverter | back to summary |
|---|---|
| public Converter | |
| getListSeparator | back to summary |
|---|---|
| public String getListSeparator() | |
| getType | back to summary |
|---|---|
| public Class | |
| isParsedAsList | back to summary |
|---|---|
| public boolean isParsedAsList() | |
| setArgName | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Sets te arg name for this option.
| |
| setChoices | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Sets the list of values accepted by this option. If the value set by the user does not match once of these
values, a
| |
| setChoicesFromEnumType | back to summary |
|---|---|
| private void setChoicesFromEnumType() Sets the list of values accepted by this option from the option's type. | |
| setConverter | back to summary |
|---|---|
| public TypedOption | |
| setDefaultValue | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Sets the default value of this option
| |
| setDescription | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Sets te description of this option.
| |
| setFlag | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Configures the current
| |
| setHidden | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Sets whether or not this option should be hidden
| |
| setListSeparator | back to summary |
|---|---|
| public TypedOption | |
| setLongName | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Sets the long name of this option.
| |
| setMultiValued | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Sets whether or not this option can receive several values.
| |
| setParsedAsList | back to summary |
|---|---|
| public TypedOption | |
| setRequired | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Sets whether or not this option is mandatory.
| |
| setShortName | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Sets the short name of this option.
| |
| setSingleValued | back to summary |
|---|---|
| public TypedOption Overrides io. Doc from io. Sets whether or not this option can receive a value.
| |
| setType | back to summary |
|---|---|
| public TypedOption | |