Interface ArgumentOption<T>
- Type Parameters:
T
- Value type
- All Superinterfaces:
Option
,Predicate<CommandSource>
,Suggester<CommandSource>
,SuggestionProvider<CommandSource>
An option that requires an argument value
Input example: key=value
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Argument option builderNested classes/interfaces inherited from interface net.forthecrown.grenadier.types.options.Option
Option.OptionBuilder<T extends Option.OptionBuilder<T>>
-
Method Summary
Modifier and TypeMethodDescription@NotNull ArgumentType<T>
Gets the option's argument type.Gets the option's default value.@Nullable Suggester<CommandSource>
Gets the suggestion provider for this option.default CompletableFuture<Suggestions>
getSuggestions
(CommandContext<CommandSource> context, SuggestionsBuilder builder) Methods inherited from interface net.forthecrown.grenadier.types.options.Option
getCondition, getLabels, getTooltip, test
-
Method Details
-
getArgumentType
Gets the option's argument type.This type is used to parse a value and also to suggest values
- Returns:
- Argument type
-
getDefaultValue
Gets the option's default value.This value will be returned when
ParsedOptions
can't find the parsed value of this option. In that case, theOption.getCondition()
result is ignored and this value will be returned.- Returns:
- Default value,
null
, if no value was set
-
getSuggester
Gets the suggestion provider for this option.Determines the value suggestions for this option, if not set, uses the suggestions provided by
getArgumentType()
- Returns:
- Suggestion provider, or
null
, if no suggestion provider was set
-
getSuggestions
default CompletableFuture<Suggestions> getSuggestions(CommandContext<CommandSource> context, SuggestionsBuilder builder) - Specified by:
getSuggestions
in interfaceSuggester<T>
- Specified by:
getSuggestions
in interfaceSuggestionProvider<T>
-