A - The actor typepublic final class ParameterTypes<A extends CommandActor>
extends java.lang.Object
ParameterTypes and
ParameterType.Factories.
This type should be constructed using builder().
ParameterType,
ContextParameter,
ParseWith| Modifier and Type | Class and Description |
|---|---|
static class |
ParameterTypes.Builder<A extends CommandActor> |
| Modifier and Type | Method and Description |
|---|---|
static <A extends CommandActor> |
builder()
Creates a new
ParameterTypes.Builder for ParameterTypes. |
<T> ParameterResolver<A,T> |
findNextResolver(java.lang.reflect.Type type,
AnnotationList annotations,
ParameterFactory skipPast,
Lamp<A> lamp)
Returns the first
ParameterType that comes after the skipPast
factory. |
<T> @NotNull ParameterResolver<A,T> |
resolver(java.lang.reflect.Type type,
AnnotationList annotations,
Lamp<A> lamp)
Returns the first
ParameterType that can parse the given type
and annotations. |
@NotNull ParameterTypes.Builder<A> |
toBuilder()
Creates a
ParameterTypes.Builder that contains the factories registered
in this registry. |
@Contract(value="-> new",
pure=true)
@NotNull
public static <A extends CommandActor> @NotNull ParameterTypes.Builder<A> builder()
ParameterTypes.Builder for ParameterTypes.A - The actor typeParameterTypes.Builder.@NotNull public <T> @NotNull ParameterResolver<A,T> resolver(java.lang.reflect.Type type, AnnotationList annotations, Lamp<A> lamp)
ParameterType that can parse the given type
and annotations. This method can be used to create more complex parameter
types for composite types (such as T[])
Note that this method will never return null. In cases where no
suitable factory is found, it will throw IllegalArgumentException.
type - The type to create forannotations - The annotations to pass to factorieslamp - The Lamp instance to pass to factoriesjava.lang.IllegalStateException - if no suitable parameter type was foundpublic <T> ParameterResolver<A,T> findNextResolver(java.lang.reflect.Type type, AnnotationList annotations, ParameterFactory skipPast, Lamp<A> lamp)
ParameterType that comes after the skipPast
factory. This is useful for adding behavior on top of existing factory.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 factoriesjava.lang.IllegalStateException - if no suitable parameter type was found@Contract(value="-> new",
pure=true)
@NotNull
public @NotNull ParameterTypes.Builder<A> toBuilder()
ParameterTypes.Builder that contains the factories registered
in this registry.