Interface FlagDescriptor

All Superinterfaces:
Descriptor
All Known Implementing Classes:
ImmutableFlagDescriptor

@Immutable @API(status=STABLE) public interface FlagDescriptor extends Descriptor
  • Method Details

    • builder

      Creates a new builder.
      Returns:
      the created builder
    • parameter

      @NonNull Parameter parameter()
      Returns the parameter.
      Returns:
      the parameter
    • name

      Returns the flag name.
      Specified by:
      name in interface Descriptor
      Returns:
      the flag name
    • aliases

      Returns an unmodifiable view of the flag aliases.
      Returns:
      the flag aliases
    • parserName

      @Nullable String parserName()
      Returns the name of the parser to use. If null the default parser for the parameter type will be used.
      Returns:
      the parser name, or null
    • suggestions

      @Nullable String suggestions()
      Returns the name of the suggestion provider to use. If the string is null, the default provider for the argument parser will be used. Otherwise, the ParserRegistry instance in the CommandManager will 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 using CommandManager.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