A - The actor typepublic static interface SuggestionProvider.Factory<A extends CommandActor> extends BaseSuggestionProvider
SuggestionProviders dynamically. This
can access the parameter type, generics and annotations.| Modifier and Type | Method and Description |
|---|---|
@Nullable SuggestionProvider<A> |
create(@NotNull java.lang.reflect.Type type,
@NotNull AnnotationList annotations,
@NotNull Lamp<A> lamp)
Creates a
SuggestionProvider for the given parameter. |
static <A extends CommandActor,L extends java.lang.annotation.Annotation> |
forAnnotation(@NotNull java.lang.Class<L> annotationType,
@NotNull java.util.function.Function<L,SuggestionProvider<A>> provider)
Returns a
SuggestionProvider.Factory that returns a suggestion provider for
all parameters that contain a specific annotation |
static <A extends CommandActor> |
forType(@NotNull java.lang.Class<?> type,
@NotNull SuggestionProvider<A> provider)
Returns a
SuggestionProvider.Factory that returns a suggestion provider for
all parameters that match a certain type. |
static <A extends CommandActor> |
forTypeAndSubclasses(@NotNull java.lang.Class<?> type,
@NotNull SuggestionProvider<A> provider)
Returns a
SuggestionProvider.Factory that returns a suggestion provider for
all parameters that match a certain type, as well as its subclasses. |
static <A extends CommandActor> SuggestionProvider.Factory<? super A> forType(@NotNull @NotNull java.lang.Class<?> type, @NotNull @NotNull SuggestionProvider<A> provider)
SuggestionProvider.Factory that returns a suggestion provider for
all parameters that match a certain type. Note that this does not
include the subclasses of such type.A - The actor typetype - Type to provide suggestions forprovider - The suggestion providerSuggestionProvider.Factory.static <A extends CommandActor> SuggestionProvider.Factory<? super A> forTypeAndSubclasses(@NotNull @NotNull java.lang.Class<?> type, @NotNull @NotNull SuggestionProvider<A> provider)
SuggestionProvider.Factory that returns a suggestion provider for
all parameters that match a certain type, as well as its subclasses.A - The actor typetype - Type to provide suggestions forprovider - The suggestion providerSuggestionProvider.Factory.@NotNull static <A extends CommandActor,L extends java.lang.annotation.Annotation> SuggestionProvider.Factory<? super A> forAnnotation(@NotNull @NotNull java.lang.Class<L> annotationType, @NotNull @NotNull java.util.function.Function<L,SuggestionProvider<A>> provider)
SuggestionProvider.Factory that returns a suggestion provider for
all parameters that contain a specific annotationA - The actor typeannotationType - The annotation type to provide suggestions forprovider - The suggestion providerSuggestionProvider.Factory.@Nullable @Nullable SuggestionProvider<A> create(@NotNull @NotNull java.lang.reflect.Type type, @NotNull @NotNull AnnotationList annotations, @NotNull @NotNull Lamp<A> lamp)
SuggestionProvider for the given parameter. If
this parameter is not applicable, null should be returned.type - Type to create forannotations - The type annotationslamp - The Lamp instancenull
if not applicable.