public static class SuggestionProviders.Builder<A extends CommandActor>
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
@NotNull SuggestionProviders.Builder<A> |
addProvider(@NotNull java.lang.Class<?> type,
@NotNull SuggestionProvider<A> provider)
Registers a
SuggestionProvider that matches a specific class. |
SuggestionProviders.Builder<A> |
addProviderFactory(SuggestionProvider.Factory<? super A> factory)
Registers a
SuggestionProvider.Factory to this registry. |
SuggestionProviders.Builder<A> |
addProviderFactoryLast(SuggestionProvider.Factory<? super A> factory)
Registers a
SuggestionProvider.Factory to this registry. |
<L extends java.lang.annotation.Annotation> |
addProviderForAnnotation(@NotNull java.lang.Class<L> type,
@NotNull java.util.function.Function<L,SuggestionProvider<A>> provider)
Registers a
SuggestionProvider that matches all parameters with a specific annotation. |
<L extends java.lang.annotation.Annotation> |
addProviderForAnnotationLast(@NotNull java.lang.Class<L> type,
@NotNull java.util.function.Function<L,SuggestionProvider<A>> provider)
Registers a
SuggestionProvider that matches all parameters with a specific
annotation. |
@NotNull SuggestionProviders.Builder<A> |
addProviderLast(@NotNull java.lang.Class<?> type,
@NotNull SuggestionProvider<A> provider)
Registers a
SuggestionProvider that matches a specific class. |
@NotNull SuggestionProviders<A> |
build()
Creates a new
SuggestionProviders instance of this builder |
@NotNull public @NotNull SuggestionProviders.Builder<A> addProvider(@NotNull @NotNull java.lang.Class<?> type, @NotNull @NotNull SuggestionProvider<A> provider)
SuggestionProvider that matches a specific class. Note
that this will not include subclasses of such class.
If you would like to include subclasses, register the factory
created by SuggestionProvider.Factory.forTypeAndSubclasses(Class, SuggestionProvider).
type - The type to register forprovider - The provider@NotNull public @NotNull SuggestionProviders.Builder<A> addProviderLast(@NotNull @NotNull java.lang.Class<?> type, @NotNull @NotNull SuggestionProvider<A> provider)
SuggestionProvider that matches a specific class. Note
that this will not include subclasses of such class.
If you would like to include subclasses, register the factory
created by SuggestionProvider.Factory.forTypeAndSubclasses(Class, SuggestionProvider).
Note that this will be given lower priority over other providers.
type - The type to register forprovider - The provider@NotNull public <L extends java.lang.annotation.Annotation> @NotNull SuggestionProviders.Builder<A> addProviderForAnnotation(@NotNull @NotNull java.lang.Class<L> type, @NotNull @NotNull java.util.function.Function<L,SuggestionProvider<A>> provider)
SuggestionProvider that matches all parameters with a specific annotation.type - The type to register forprovider - The provider@NotNull public <L extends java.lang.annotation.Annotation> @NotNull SuggestionProviders.Builder<A> addProviderForAnnotationLast(@NotNull @NotNull java.lang.Class<L> type, @NotNull @NotNull java.util.function.Function<L,SuggestionProvider<A>> provider)
SuggestionProvider that matches all parameters with a specific
annotation.
Note that this will be given lower priority over other providers.
type - The type to register forprovider - The providerpublic SuggestionProviders.Builder<A> addProviderFactory(@NotNull SuggestionProvider.Factory<? super A> factory)
SuggestionProvider.Factory to this registry.factory - The factory to registerpublic SuggestionProviders.Builder<A> addProviderFactoryLast(@NotNull SuggestionProvider.Factory<? super A> factory)
SuggestionProvider.Factory to this registry.
Note that this will be given lower priority over other providers.
factory - The factory to register@Contract(pure=true,
value="-> new")
@NotNull
public @NotNull SuggestionProviders<A> build()
SuggestionProviders instance of this builderSuggestionProviders registry.