public interface CommandParameter
Parameter.| Modifier and Type | Method and Description |
|---|---|
@NotNull AnnotationList |
annotations()
Returns the list of annotations present on this parameter.
|
@NotNull java.lang.reflect.Type |
fullType()
Returns the full type of the parameter, including generics.
|
@NotNull java.util.List<java.lang.reflect.Type> |
generics()
Returns a list of generic types associated with this parameter.
|
default <T extends java.lang.annotation.Annotation> |
getAnnotation(@NotNull java.lang.Class<T> type)
Returns the given annotation, or
null if it's not annotated
with the given annotation (or distributed on, indirectly) |
default boolean |
hasAnnotation(@NotNull java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Tests whether this parameter has the given annotation or not
|
boolean |
isLastInMethod()
Tests whether is this parameter the last in the method or not
|
boolean |
isOptional()
Tests whether is this parameter optional or not.
|
@NotNull java.lang.reflect.Method |
method()
Returns the method associated with this parameter.
|
int |
methodIndex()
Returns the index of this parameter in the method.
|
@NotNull java.lang.String |
name()
Returns the name of the parameter.
|
@NotNull java.lang.reflect.Parameter |
parameter()
Returns the underlying
Parameter |
@NotNull java.lang.Class<?> |
type()
Returns the raw class type of the parameter.
|
@NotNull @NotNull java.lang.String name()
ParameterNamingStrategy
or overridden explicitly using @Namedint methodIndex()
boolean isLastInMethod()
@NotNull @NotNull java.lang.reflect.Parameter parameter()
Parameter@NotNull @NotNull java.lang.reflect.Method method()
@NotNull @NotNull AnnotationList annotations()
@NotNull @NotNull java.lang.Class<?> type()
@NotNull @NotNull java.lang.reflect.Type fullType()
@NotNull @NotNull java.util.List<java.lang.reflect.Type> generics()
If this parameter is not parameterized, this will be an empty list.
boolean isOptional()
This will return true in these cases:
default boolean hasAnnotation(@NotNull
@NotNull java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType - The annotation type to check fortrue if the annotation is present, false if otherwise.@Nullable
default <T extends java.lang.annotation.Annotation> T getAnnotation(@NotNull
@NotNull java.lang.Class<T> type)
null if it's not annotated
with the given annotation (or distributed on, indirectly)T - The annotation type automatically casttype - The annotation typenull if not
present