public final class EnumeratedStringOption extends EnumeratedOption<String>
Option with value restricted to a
specified enumeration of type String.allowedValuesbundle, ILLEGAL_SN_CHARS, locale, MAX_COUNT_LIMIT, MIN_COUNT_LIMIT, values| Constructor and Description |
|---|
EnumeratedStringOption(String shortName,
String longName,
String description,
boolean mandatory,
boolean allowMany,
Collection<String> allowedValues,
boolean ignoreCase)
Creates a new
EnumeratedStringOption instance. |
EnumeratedStringOption(String shortName,
String longName,
String description,
int minCount,
int maxCount,
Collection<String> allowedValues,
boolean ignoreCase)
Creates a new
EnumeratedStringOption instance. |
| Modifier and Type | Method and Description |
|---|---|
String |
getAllowedValuesString()
Returns the default version of the string denoting the values that
can be assigned to this option ()
|
Class<String> |
getType()
Returns the class type of value this option can take.
|
protected String |
parseValue(String arg)
Parses the argument string for an option value.
|
getAllowedValues, getAllowedValuesString, getAllowedValuesString, isValueValid, toStringaddValue, equals, getDescription, getLongName, getMaxCount, getMinCount, getShortName, getUsageTypeString, getValues, hashCode, isAllowMany, isHidden, isMandatory, requiresValue, setHidden, setMinMaxCountspublic EnumeratedStringOption(String shortName, String longName, String description, int minCount, int maxCount, Collection<String> allowedValues, boolean ignoreCase)
EnumeratedStringOption instance.shortName - short name of the option (e.g. -t)longName - long name of the option (e.g. --type)description - helpful description of the option (printed for usage message)minCount - minimum number of occurrences required for this optionmaxCount - maximum number of occurrences required for this optionallowedValues - collection of possible values this option can takeignoreCase - whether to ignore the case in string evaluationspublic EnumeratedStringOption(String shortName, String longName, String description, boolean mandatory, boolean allowMany, Collection<String> allowedValues, boolean ignoreCase)
EnumeratedStringOption instance.shortName - short name of the option (e.g. -t)longName - long name of the option (e.g. --type)description - helpful description of the option (printed for usage message)mandatory - whether this option must be specifiedallowMany - whether this option can take more than one value (i.e. be specified more than once)allowedValues - collection of possible values this option can takeignoreCase - whether to ignore the case in string evaluationsprotected String parseValue(String arg) throws OptionException
parseValue in class Option<String>arg - string argument from which a value is to be parsedOptionException - if a problem occurs while parsing the argument stringpublic Class<String> getType()
Optionpublic String getAllowedValuesString()
getAllowedValuesString in class EnumeratedOption<String>Copyright © 2017. All rights reserved.