Class Options
java.lang.Object
net.forthecrown.grenadier.types.options.Options
Static factory class for
FlagOption
and ArgumentOption
instances and builders.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ArgumentOption.Builder<T>
argument
(ArgumentType<T> type) Creates a new argument option builderstatic <T> ArgumentOption<T>
argument
(ArgumentType<T> type, String label) Creates an argument option with a single labelstatic FlagOption.Builder
flag()
Creates a new flag builderstatic FlagOption
Creates a flag option with a single labelstatic void
validateLabel
(String label) Tests if a specifiedlabel
is a valid label for an option.
-
Method Details
-
flag
Creates a new flag builder- Returns:
- Created flag builder
-
flag
Creates a flag option with a single label- Parameters:
label
- Flag label- Returns:
- Created flag option
-
argument
Creates a new argument option builder- Type Parameters:
T
- Option value's type- Parameters:
type
- Option type- Returns:
- Created builder
-
argument
Creates an argument option with a single label- Type Parameters:
T
- Option value's type- Parameters:
type
- Option typelabel
- Option label- Returns:
- Created option
-
validateLabel
Tests if a specifiedlabel
is a valid label for an option.Labels have to match the
Readers.WORD_PATTERN
to be considered valid labels.- Parameters:
label
- Label to test- Throws:
IllegalArgumentException
- If the label was invalid
-