Interface FlagDescriptor
- All Superinterfaces:
Descriptor
- All Known Implementing Classes:
ImmutableFlagDescriptor
-
Method Summary
Modifier and TypeMethodDescriptionaliases()Returns an unmodifiable view of the flag aliases.builder()Creates a new builder.Returns the description of the flag.name()Returns the flag name.Returns the parameter.Returns the name of the parser to use.Returns the permission of the flag.booleanReturns whether the flag is repeatable.Returns the name of the suggestion provider to use.
-
Method Details
-
builder
Creates a new builder.- Returns:
- the created builder
-
parameter
Returns the parameter.- Returns:
- the parameter
-
name
Returns the flag name.- Specified by:
namein interfaceDescriptor- Returns:
- the flag name
-
aliases
@NonNull Collection<@NonNull String> aliases()Returns an unmodifiable view of the flag aliases.- Returns:
- the flag aliases
-
parserName
Returns the name of the parser to use. Ifnullthe default parser for the parameter type will be used.- Returns:
- the parser name, or
null
-
suggestions
Returns the name of the suggestion provider to use. If the string isnull, the default provider for the argument parser will be used. Otherwise, theParserRegistryinstance in theCommandManagerwill be queried for a matching suggestion provider.For this to work, the suggestion needs to be registered in the parser registry. To do this, use
ParserRegistry.registerSuggestionProvider(String, SuggestionProvider). The registry instance can be retrieved usingCommandManager.parserRegistry().- Returns:
- the name of the suggestion provider, or
null
-
permission
@Nullable Permission permission()Returns the permission of the flag.- Returns:
- the flag permission, or
null
-
description
@Nullable Description description()Returns the description of the flag.- Returns:
- the flag description, or
null
-
repeatable
boolean repeatable()Returns whether the flag is repeatable.- Returns:
- whether the flag is repeatable
-