Interface BlockingSuggestionProvider.Strings<C>

Type Parameters:
C - command sender type
All Superinterfaces:
BlockingSuggestionProvider<C>, SuggestionProvider<C>
All Known Implementing Classes:
BooleanParser, ByteParser, DurationParser, EnumParser, IntegerParser, LiteralParser, LongParser, ShortParser
Enclosing interface:
BlockingSuggestionProvider<C>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @API(status=STABLE) public static interface BlockingSuggestionProvider.Strings<C> extends BlockingSuggestionProvider<C>
Specialized variant of BlockingSuggestionProvider that has String results instead of Suggestion results.

The provided default implementation of suggestions(CommandContext, CommandInput) maps the String results to suggestions using Suggestion.suggestion(String).

  • Method Details

    • stringSuggestions

      @NonNull Iterable<@NonNull String> stringSuggestions(@NonNull CommandContext<C> commandContext, @NonNull CommandInput input)
      Returns the suggestions for the given input.

      The input parameter contains all sender-provided input that has not yet been consumed by the argument parsers. If the component that the suggestion provider is generating suggestions for consumes multiple tokens the suggestion provider might receive a CommandInput instance containing multiple tokens. CommandInput.lastRemainingToken() may be used to extract the part of the command that is currently being completed by the command sender.

      Parameters:
      commandContext - Command context
      input - Input string
      Returns:
      List of suggestions
    • suggestions

      Description copied from interface: BlockingSuggestionProvider
      Returns the suggestions for the given input.

      The input parameter contains all sender-provided input that has not yet been consumed by the argument parsers. If the component that the suggestion provider is generating suggestions for consumes multiple tokens the suggestion provider might receive a CommandInput instance containing multiple tokens. CommandInput.lastRemainingToken() may be used to extract the part of the command that is currently being completed by the command sender.

      Specified by:
      suggestions in interface BlockingSuggestionProvider<C>
      Parameters:
      context - the context of the suggestion lookup
      input - the current input
      Returns:
      the suggestions