T
- The argument typepublic interface Argument<T> extends TypeVariableResolver, Named, AnnotationMetadataProvider, Type
Modifier and Type | Field and Description |
---|---|
static Argument |
BOOLEAN
Constant for boolean argument.
|
static Argument |
BYTE
Constant for byte argument.
|
static Argument |
CHAR
Constant char argument.
|
static Argument |
DOUBLE
Constant for double argument.
|
static Argument |
FLOAT
Constant for float argument.
|
static Argument |
INT
Constant for int argument.
|
static Argument |
LONG
Constant for long argument.
|
static Argument<Object> |
OBJECT_ARGUMENT
Default Object argument.
|
static Argument |
SHORT
Constant short argument.
|
static Argument |
VOID
Constant for void argument.
|
static Argument[] |
ZERO_ARGUMENTS
Constant representing zero arguments.
|
EMPTY
Modifier and Type | Method and Description |
---|---|
boolean |
equalsType(Argument<?> other)
Whether the types are equivalent.
|
String |
getName() |
Class<T> |
getType() |
default String |
getTypeName() |
default String |
getTypeString(boolean simple)
Returns the string representation of the argument type, including generics.
|
default boolean |
hasTypeVariables() |
default boolean |
isInstance(Object o)
Whether the given argument is an instance.
|
static <T> Argument<List<T>> |
listOf(Class<T> type)
Creates a new argument representing a generic list.
|
static <K,V> Argument<Map<K,V>> |
mapOf(Class<K> keyType,
Class<V> valueType)
Creates a new argument representing a generic map.
|
static <T> Argument<T> |
of(Class<T> type)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(Class<T> type,
Argument... typeParameters)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(Class<T> type,
Class<?>... typeParameters)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(Class<T> type,
String name)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(Class<T> type,
String name,
AnnotationMetadata annotationMetadata,
Argument... typeParameters)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(Class<T> type,
String name,
Argument... typeParameters)
Creates a new argument for the given type and name.
|
static <T> Argument<Set<T>> |
setOf(Class<T> type)
Creates a new argument representing a generic set.
|
static Class[] |
toClassArray(Argument... arguments)
Convert an argument array to a class array.
|
static String |
toString(Argument... arguments)
Convert the arguments to a string representation.
|
int |
typeHashCode()
The hash code including only the types.
|
getFirstTypeVariable, getTypeParameters, getTypeVariable, getTypeVariables
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation
static final Argument INT
static final Argument LONG
static final Argument FLOAT
static final Argument DOUBLE
static final Argument VOID
static final Argument BYTE
static final Argument BOOLEAN
static final Argument CHAR
static final Argument SHORT
static final Argument[] ZERO_ARGUMENTS
@Nonnull default String getTypeName()
getTypeName
in interface Type
boolean equalsType(Argument<?> other)
Object.equals(Object)
implementation includes the argument
name within the comparison so this method offers a variation that just compares types.other
- The type typeint typeHashCode()
Object.hashCode()
implementation includes the
argument name within the comparison so this method offers a variation that just compares types.default boolean isInstance(@Nullable Object o)
o
- The objectdefault String getTypeString(boolean simple)
simple
- If true, output the simple name of typesdefault boolean hasTypeVariables()
@Nonnull static Class[] toClassArray(Argument... arguments)
arguments
- The arguments@Nonnull static String toString(Argument... arguments)
arguments
- The arguments@Nonnull static <T> Argument<T> of(Class<T> type, String name, @Nullable Argument... typeParameters)
T
- The generic typetype
- The typename
- The nametypeParameters
- the type parameters@Nonnull static <T> Argument<T> of(Class<T> type, String name, AnnotationMetadata annotationMetadata, @Nullable Argument... typeParameters)
T
- The generic typetype
- The typename
- The nameannotationMetadata
- the annotation metadatatypeParameters
- the type parameters@Nonnull static <T> Argument<T> of(Class<T> type, String name)
T
- The generic typetype
- The typename
- The name@Nonnull static <T> Argument<T> of(Class<T> type, @Nullable Argument... typeParameters)
T
- The generic typetype
- The typetypeParameters
- The parameters type@Nonnull static <T> Argument<T> of(Class<T> type)
T
- The generic typetype
- The type@Nonnull static <T> Argument<T> of(Class<T> type, @Nullable Class<?>... typeParameters)
T
- The generic typetype
- The typetypeParameters
- the parameters type@Nonnull static <T> Argument<List<T>> listOf(Class<T> type)
T
- list element typetype
- list element type@Nonnull static <T> Argument<Set<T>> setOf(Class<T> type)
T
- set element typetype
- set element type