@FunctionalInterface public interface SuggestionProvider<A extends CommandActor> extends BaseSuggestionProvider
| Modifier and Type | Interface and Description |
|---|---|
static interface |
SuggestionProvider.Factory<A extends CommandActor>
Represents a factory that creates
SuggestionProviders dynamically. |
| Modifier and Type | Method and Description |
|---|---|
static <A extends CommandActor> |
empty()
Returns a
SuggestionProvider that always gives empty suggestions. |
static <A extends CommandActor> |
fromAsync(@NotNull AsyncSuggestionProvider<A> provider)
Creates a
SuggestionProvider that provides suggestions asynchronously. |
@NotNull java.util.Collection<java.lang.String> |
getSuggestions(@NotNull ExecutionContext<A> context)
Returns the suggestions
|
static <A extends CommandActor> |
of(@NotNull java.util.List<java.lang.String> suggestions)
Returns a
SuggestionProvider that provides a static list of suggestions |
static <A extends CommandActor> |
of(java.lang.String... suggestions)
Returns a
SuggestionProvider that provides a static list of suggestions |
@NotNull static <A extends CommandActor> @NotNull SuggestionProvider<A> empty()
SuggestionProvider that always gives empty suggestions.A - The actor type@Contract(value="_ -> new") @NotNull static <A extends CommandActor> @NotNull SuggestionProvider<A> fromAsync(@NotNull @NotNull AsyncSuggestionProvider<A> provider)
SuggestionProvider that provides suggestions asynchronously.
Note: The ability to provide asynchronous completions is platform-dependent.
In platforms where such behavior is unsupported, Lamp will fall back to
normal completions, and AsyncSuggestionProvider.getSuggestionsAsync(ExecutionContext) will
block.
A - The actor typeprovider - The asynchronous providerSuggestionProvider@NotNull static <A extends CommandActor> @NotNull SuggestionProvider<A> of(@NotNull java.lang.String... suggestions)
SuggestionProvider that provides a static list of suggestionsA - The actor typesuggestions - Suggestions to provide@NotNull static <A extends CommandActor> @NotNull SuggestionProvider<A> of(@NotNull @NotNull java.util.List<java.lang.String> suggestions)
SuggestionProvider that provides a static list of suggestionsA - The actor typesuggestions - Suggestions to provide@NotNull
@NotNull java.util.Collection<java.lang.String> getSuggestions(@NotNull
@NotNull ExecutionContext<A> context)
context - The execution context. This will try to parse
arguments inputted by the user and store them
to provide context-aware suggestions.