A - The actor typepublic final class SuggestionProviders<A extends CommandActor>
extends java.lang.Object
SuggestionProviders and
SuggestionProvider.Factories.
This type should be constructed using builder().
| Modifier and Type | Class and Description |
|---|---|
static class |
SuggestionProviders.Builder<A extends CommandActor> |
| Modifier and Type | Method and Description |
|---|---|
static <A extends CommandActor> |
builder()
Creates a new
SuggestionProviders.Builder for SuggestionProviders. |
@NotNull SuggestionProvider<A> |
findNextProvider(@NotNull java.lang.reflect.Type type,
@NotNull AnnotationList annotations,
@NotNull SuggestionProvider.Factory<? super A> skipPast,
@NotNull Lamp<A> lamp)
Returns the first
SuggestionProvider that comes after the skipPast
factory. |
@NotNull SuggestionProvider<A> |
provider(@NotNull CommandParameter parameter,
@NotNull Lamp<A> lamp)
Returns the first
SuggestionProvider that can create suggestions
for the given parameter. |
@NotNull SuggestionProvider<A> |
provider(@NotNull java.lang.reflect.Type type,
@NotNull AnnotationList annotations,
@NotNull Lamp<A> lamp)
Returns the first
SuggestionProvider that can create suggestions
for the given type and annotations. |
@NotNull SuggestionProviders.Builder<A> |
toBuilder()
Creates a
SuggestionProviders.Builder that contains the providers registered
in this registry. |
@Contract(value="-> new",
pure=true)
@NotNull
public static <A extends CommandActor> @NotNull SuggestionProviders.Builder<A> builder()
SuggestionProviders.Builder for SuggestionProviders.A - The actor typeSuggestionProviders.Builder.@NotNull public @NotNull SuggestionProvider<A> provider(@NotNull @NotNull CommandParameter parameter, @NotNull @NotNull Lamp<A> lamp)
SuggestionProvider that can create suggestions
for the given parameter.
Note that this method will never return null. In cases
where no suitable provider is found, it will return SuggestionProvider.empty().
parameter - The parameter to create forlamp - The Lamp instance to pass to factoriesSuggestionProvider.empty().@NotNull public @NotNull SuggestionProvider<A> provider(@NotNull @NotNull java.lang.reflect.Type type, @NotNull @NotNull AnnotationList annotations, @NotNull @NotNull Lamp<A> lamp)
SuggestionProvider that can create suggestions
for the given type and annotations. This method can be used
to create more complex suggestion providers for composite types (such as T[])
Note that this method will never return null. In cases where no
suitable provider is found, it will return SuggestionProvider.empty().
type - The type to create forannotations - The annotations to pass to factorieslamp - The Lamp instance to pass to factoriesSuggestionProvider.empty().@NotNull public @NotNull SuggestionProvider<A> findNextProvider(@NotNull @NotNull java.lang.reflect.Type type, @NotNull @NotNull AnnotationList annotations, @NotNull @NotNull SuggestionProvider.Factory<? super A> skipPast, @NotNull @NotNull Lamp<A> lamp)
SuggestionProvider that comes after the skipPast
factory. This is useful for adding behavior on top of existing providers.type - The type to create forannotations - The annotations to pass to factoriesskipPast - The factory to skip past. In most cases, this will be the caller factory,
i.e. this.lamp - The Lamp instance to pass to factoriesSuggestionProvider.empty().@Contract(value="-> new",
pure=true)
@NotNull
public @NotNull SuggestionProviders.Builder<A> toBuilder()
SuggestionProviders.Builder that contains the providers registered
in this registry.