Package de.hsh.graja.util.cli
Class Option<T>
java.lang.Object
de.hsh.graja.util.cli.Option<T>
- Direct Known Subclasses:
BooleanOption
,DoubleOption
,IntegerOption
,KeyValuePairOption
,PathOption
,StringOption
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract T
Converts a string-typed argument to the type represented by this DataType.getName()
List<ValidValues<T>>
If any of the element in this list validates a given value as correct, then it is correct.boolean
void
setDefaultValue
(DescribedOptionValue defaultValue) void
setDescription
(List<String> description) void
setMandatory
(Boolean mandatory) void
setMeaning
(List<String> meaning) void
void
setValidValues
(List<ValidValues<T>> validValues) toString()
-
Constructor Details
-
Option
public Option()
-
-
Method Details
-
getName
-
setName
-
getDescription
-
setDescription
-
getMandatory
- Returns:
- null means optional
-
isMandatory
public boolean isMandatory() -
setMandatory
-
getDefaultValue
-
setDefaultValue
-
getMeaning
- Returns:
- The meaning of a value of this data type. Most of the time the meaning is a word describing the data type itself. E. g. "number" or "path". Sometimes there are better names like "id", "file", "directory", "name", "format" etc. The meaning will be printed like this in the help page: <meaning>
-
setMeaning
-
getValidValues
If any of the element in this list validates a given value as correct, then it is correct. Hence, the list is meant as union set of valid values. -
setValidValues
-
convertImpl
Converts a string-typed argument to the type represented by this DataType. No validation against valid values will happen.- Parameters:
ov
-- Returns:
- converted value
- Throws:
InvalidValueException
-
toString
-