A - Actor typepublic static interface ResponseHandler.Factory<A extends CommandActor>
ResponseHandlers dynamically. This
factory can access the response Type and function annotations, as
well as other registered response handlers.
This may be used to create more complex response handlers by
composing them, such as Optional<T>, Supplier<T>, etc.
| Modifier and Type | Method and Description |
|---|---|
<T> @Nullable ResponseHandler<A,T> |
create(@NotNull java.lang.reflect.Type type,
@NotNull AnnotationList annotations,
@NotNull Lamp<A> lamp)
Creates a new
CommandPermission for the given type and list of annotations. |
static <A extends CommandActor,T> |
forType(@NotNull java.lang.Class<T> type,
@NotNull ResponseHandler<A,T> responseHandler)
Creates a new
ParameterType.Factory that returns a ParameterType for all
parameters that exactly have a certain class. |
static <A extends CommandActor,T> |
forTypeAndSubclasses(@NotNull java.lang.Class<T> type,
@NotNull ResponseHandler<A,T> responseHandler)
Creates a new
ParameterType.Factory that returns a ParameterType for all
parameters that are assignable from the given type. |
@NotNull static <A extends CommandActor,T> @NotNull ResponseHandler.Factory<A> forType(@NotNull @NotNull java.lang.Class<T> type, @NotNull @NotNull ResponseHandler<A,T> responseHandler)
ParameterType.Factory that returns a ParameterType for all
parameters that exactly have a certain class.A - The actor typeT - The parameter typetype - Parameter type to check againstresponseHandler - The parameter type to supply@NotNull static <A extends CommandActor,T> @NotNull ResponseHandler.Factory<A> forTypeAndSubclasses(@NotNull @NotNull java.lang.Class<T> type, @NotNull @NotNull ResponseHandler<A,T> responseHandler)
ParameterType.Factory that returns a ParameterType for all
parameters that are assignable from the given type.
Checking is done using Class.isAssignableFrom(Class).
A - The actor typeT - The parameter typetype - Parameter type to check againstresponseHandler - The parameter type to supply@Nullable <T> @Nullable ResponseHandler<A,T> create(@NotNull @NotNull java.lang.reflect.Type type, @NotNull @NotNull AnnotationList annotations, @NotNull @NotNull Lamp<A> lamp)
CommandPermission for the given type and list of annotations. These
annotations will usually represent the ones on the function
If this factory is not responsible for the given input, it may return
null.
annotations - The annotation listlamp - The Lamp instance