Package org.incendo.cloud.suggestion
Interface SuggestionFactory<C,S extends Suggestion>
- Type Parameters:
C- the command sender typeS- the tooltip type
- All Known Implementing Classes:
DelegatingSuggestionFactory
Factory that produces command suggestions from user input.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <S2 extends Suggestion>
@NonNull SuggestionFactory<C, S2> mapped(@NonNull SuggestionMapper<S2> mapper) Returns a new suggestion factory that maps the results ofthisfactory to the typeSuggestionFactoryusing the givenmapper.Returns command suggestions for the "next" argument that would yield a correctly parsing command inputReturns command suggestions for the "next" argument that would yield a correctly parsing command inputdefault @NonNull Suggestions<C, S> suggestImmediately(@NonNull C sender, @NonNull String input) Returns command suggestions for the "next" argument that would yield a correctly parsing command input
-
Method Details
-
suggest
@NonNull CompletableFuture<@NonNull Suggestions<C,S>> suggest(@NonNull CommandContext<C> context, @NonNull String input) Returns command suggestions for the "next" argument that would yield a correctly parsing command input- Parameters:
context- request contextinput- input provided by the sender- Returns:
- the suggestions
-
suggest
@NonNull CompletableFuture<@NonNull Suggestions<C,S>> suggest(@NonNull C sender, @NonNull String input) Returns command suggestions for the "next" argument that would yield a correctly parsing command input- Parameters:
sender- the senderinput- input provided by the sender- Returns:
- the suggestions
-
suggestImmediately
Returns command suggestions for the "next" argument that would yield a correctly parsing command input- Parameters:
sender- the senderinput- input provided by the sender- Returns:
- the suggestions
-
mapped
default <S2 extends Suggestion> @NonNull SuggestionFactory<C,S2> mapped(@NonNull SuggestionMapper<S2> mapper) Returns a new suggestion factory that maps the results ofthisfactory to the typeSuggestionFactoryusing the givenmapper.- Type Parameters:
S2- the new suggestion type- Parameters:
mapper- the suggestion mapper- Returns:
- the mapped factory
-