public static class ParameterTypes.Builder<A extends CommandActor>
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
<T> ParameterTypes.Builder<A> |
addContextParameter(@NotNull java.lang.Class<T> parameterClass,
@NotNull ContextParameter<? super A,T> type)
Registers a
ParameterType that matches a specific class. |
ParameterTypes.Builder<A> |
addContextParameterFactory(ContextParameter.Factory<? super A> factory)
Registers a
ParameterType.Factory to this registry. |
ParameterTypes.Builder<A> |
addContextParameterFactoryLast(ContextParameter.Factory<? super A> factory)
Registers a
ParameterType.Factory to this registry. |
<T> ParameterTypes.Builder<A> |
addContextParameterLast(@NotNull java.lang.Class<T> parameterClass,
@NotNull ContextParameter<? super A,T> contextParameter)
Registers a
ParameterType that matches a specific class. |
<T> ParameterTypes.Builder<A> |
addParameterType(@NotNull java.lang.Class<T> parameterClass,
@NotNull ParameterType<? super A,T> type)
Registers a
ParameterType that matches a specific class. |
ParameterTypes.Builder<A> |
addParameterTypeFactory(ParameterType.Factory<? super A> factory)
Registers a
ParameterType.Factory to this registry. |
ParameterTypes.Builder<A> |
addParameterTypeFactoryLast(ParameterType.Factory<? super A> factory)
Registers a
ParameterType.Factory to this registry. |
<T> ParameterTypes.Builder<A> |
addParameterTypeLast(@NotNull java.lang.Class<T> parameterClass,
@NotNull ParameterType<? super A,T> parameterType)
Registers a
ParameterType that matches a specific class. |
@NotNull ParameterTypes<A> |
build()
Creates a new
ParameterTypes instance of this builder |
public <T> ParameterTypes.Builder<A> addParameterType(@NotNull @NotNull java.lang.Class<T> parameterClass, @NotNull @NotNull ParameterType<? super A,T> type)
ParameterType 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 ParameterType.Factory.forTypeAndSubclasses(Class, ParameterType).
parameterClass - The type to register fortype - The parameter typepublic <T> ParameterTypes.Builder<A> addParameterTypeLast(@NotNull @NotNull java.lang.Class<T> parameterClass, @NotNull @NotNull ParameterType<? super A,T> parameterType)
ParameterType 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 ParameterType.Factory.forTypeAndSubclasses(Class, ParameterType).
Note that this will be given lower priority over other factories.
parameterClass - The type to register forparameterType - The type to usepublic ParameterTypes.Builder<A> addParameterTypeFactory(@NotNull ParameterType.Factory<? super A> factory)
ParameterType.Factory to this registry.factory - The factory to registerpublic ParameterTypes.Builder<A> addParameterTypeFactoryLast(@NotNull ParameterType.Factory<? super A> factory)
ParameterType.Factory to this registry.
Note that this will be given lower priority over other factories.
factory - The factory to registerpublic <T> ParameterTypes.Builder<A> addContextParameter(@NotNull @NotNull java.lang.Class<T> parameterClass, @NotNull @NotNull ContextParameter<? super A,T> type)
ParameterType 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 ParameterType.Factory.forTypeAndSubclasses(Class, ParameterType).
parameterClass - The type to register fortype - The parameter typepublic <T> ParameterTypes.Builder<A> addContextParameterLast(@NotNull @NotNull java.lang.Class<T> parameterClass, @NotNull @NotNull ContextParameter<? super A,T> contextParameter)
ParameterType 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 ParameterType.Factory.forTypeAndSubclasses(Class, ParameterType).
Note that this will be given lower priority over other factories.
contextParameter - The context parameter typeparameterClass - The type to register forpublic ParameterTypes.Builder<A> addContextParameterFactory(@NotNull ContextParameter.Factory<? super A> factory)
ParameterType.Factory to this registry.factory - The factory to registerpublic ParameterTypes.Builder<A> addContextParameterFactoryLast(@NotNull ContextParameter.Factory<? super A> factory)
ParameterType.Factory to this registry.
Note that this will be given lower priority over other factories.
factory - The factory to register@Contract(pure=true,
value="-> new")
@NotNull
public @NotNull ParameterTypes<A> build()
ParameterTypes instance of this builderParameterTypes registry.