T - The argument typepublic interface Argument<T> extends TypeInformation<T>, AnnotatedElement, java.lang.reflect.Type
| Modifier and Type | Field and Description |
|---|---|
static Argument<java.lang.Boolean> |
BOOLEAN
Constant for boolean argument.
|
static Argument<java.lang.Byte> |
BYTE
Constant for byte argument.
|
static Argument<java.lang.Character> |
CHAR
Constant char argument.
|
static Argument<java.lang.Double> |
DOUBLE
Constant for double argument.
|
static Argument<java.lang.Float> |
FLOAT
Constant for float argument.
|
static Argument<java.lang.Integer> |
INT
Constant for int argument.
|
static Argument<java.util.List<java.lang.String>> |
LIST_OF_STRING
Constant for List
|
static Argument<java.lang.Long> |
LONG
Constant for long argument.
|
static Argument<java.lang.Object> |
OBJECT_ARGUMENT
Default Object argument.
|
static Argument<java.lang.Short> |
SHORT
Constant short argument.
|
static Argument<java.lang.String> |
STRING
Constant for string argument.
|
static Argument<java.lang.Void> |
VOID
Constant for void argument.
|
static Argument<java.lang.Void> |
VOID_OBJECT
Constant for Void object 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.
|
java.lang.String |
getName() |
default boolean |
isAssignableFrom(Argument<?> candidateArgument)
Checks if the argument can be assigned to this argument.
|
default boolean |
isAssignableFrom(java.lang.Class<?> candidateType)
Delegates to
Class.isAssignableFrom(Class) for this argument. |
default boolean |
isInstance(java.lang.Object o)
Whether the given argument is an instance.
|
default boolean |
isTypeVariable()
Whether this argument is a type variable used in generics.
|
static <T> Argument<java.util.List<T>> |
listOf(Argument<T> type)
Creates a new argument representing a generic list.
|
static <T> Argument<java.util.List<T>> |
listOf(java.lang.Class<T> type)
Creates a new argument representing a generic list.
|
static <K,V> Argument<java.util.Map<K,V>> |
mapOf(Argument<K> keyType,
Argument<V> valueType)
Creates a new argument representing a generic map.
|
static <K,V> Argument<java.util.Map<K,V>> |
mapOf(java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
Creates a new argument representing a generic map.
|
static <T> Argument<T> |
of(java.lang.Class<T> type)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(java.lang.Class<T> type,
AnnotationMetadata annotationMetadata,
Argument<?>... typeParameters)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(java.lang.Class<T> type,
AnnotationMetadata annotationMetadata,
java.lang.Class<?>[] typeParameters)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(java.lang.Class<T> type,
Argument<?>... typeParameters)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(java.lang.Class<T> type,
java.lang.Class<?>... typeParameters)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(java.lang.Class<T> type,
java.lang.String name)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(java.lang.Class<T> type,
java.lang.String name,
AnnotationMetadata annotationMetadata,
Argument<?>... typeParameters)
Creates a new argument for the given type and name.
|
static <T> Argument<T> |
of(java.lang.Class<T> type,
java.lang.String name,
Argument<?>... typeParameters)
Creates a new argument for the given type and name.
|
static Argument<?> |
of(java.lang.reflect.Type type)
Allows coercing a
Type instance to an Argument. |
static <T> Argument<T> |
ofTypeVariable(java.lang.Class<T> type,
java.lang.String name)
Creates a new argument for the given type and name that is a type variable.
|
static <T> Argument<T> |
ofTypeVariable(java.lang.Class<T> type,
java.lang.String name,
AnnotationMetadata annotationMetadata,
Argument<?>... typeParameters)
Creates a new argument for the given type and name that is a type variable.
|
static <T> Argument<T> |
ofTypeVariable(java.lang.Class<T> type,
java.lang.String argumentName,
java.lang.String variableName)
Creates a new argument for the given type and name that is a type variable.
|
static <T> Argument<T> |
ofTypeVariable(java.lang.Class<T> type,
java.lang.String argumentName,
java.lang.String variableName,
AnnotationMetadata annotationMetadata,
Argument<?>... typeParameters)
Creates a new argument for the given type and name that is a type variable.
|
static <T> Argument<java.util.Set<T>> |
setOf(Argument<T> type)
Creates a new argument representing a generic set.
|
static <T> Argument<java.util.Set<T>> |
setOf(java.lang.Class<T> type)
Creates a new argument representing a generic set.
|
static java.lang.Class<?>[] |
toClassArray(Argument<?>... arguments)
Convert an argument array to a class array.
|
static java.lang.String |
toString(Argument<?>... arguments)
Convert the arguments to a string representation.
|
int |
typeHashCode()
The hash code including only the types.
|
asParameterizedType, getSimpleName, getType, getTypeName, getTypeString, getWrappedType, getWrapperType, hasTypeVariables, isArray, isAsync, isAsyncOrReactive, isCompletable, isContainerType, isOptional, isPrimitive, isProvider, isReactive, isSpecifiedSingle, isVoid, isWrapperTypegetFirstTypeVariable, getTypeParameters, getTypeVariable, getTypeVariablesisDeclaredNonNull, isDeclaredNullable, isNonNull, isNullablefindAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypegetAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclaredstatic final Argument<java.lang.String> STRING
static final Argument<java.lang.Integer> INT
static final Argument<java.lang.Long> LONG
static final Argument<java.lang.Float> FLOAT
static final Argument<java.lang.Double> DOUBLE
static final Argument<java.lang.Void> VOID
static final Argument<java.lang.Byte> BYTE
static final Argument<java.lang.Boolean> BOOLEAN
static final Argument<java.lang.Character> CHAR
static final Argument<java.lang.Short> SHORT
static final Argument[] ZERO_ARGUMENTS
static final Argument<java.lang.Object> OBJECT_ARGUMENT
static final Argument<java.util.List<java.lang.String>> LIST_OF_STRING
static final Argument<java.lang.Void> VOID_OBJECT
@NonNull java.lang.String getName()
boolean equalsType(@Nullable 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 isTypeVariable()
default boolean isInstance(@Nullable java.lang.Object o)
o - The objectdefault boolean isAssignableFrom(@NonNull java.lang.Class<?> candidateType)
Class.isAssignableFrom(Class) for this argument.candidateType - The candidate typedefault boolean isAssignableFrom(@NonNull Argument<?> candidateArgument)
candidateArgument - The candidate argument@NonNull static java.lang.Class<?>[] toClassArray(@Nullable Argument<?>... arguments)
arguments - The arguments@NonNull static java.lang.String toString(@Nullable Argument<?>... arguments)
arguments - The arguments@NonNull static <T> Argument<T> of(@NonNull java.lang.Class<T> type, @Nullable java.lang.String name, @Nullable Argument<?>... typeParameters)
T - The generic typetype - The typename - The nametypeParameters - the type parameters@NonNull static <T> Argument<T> ofTypeVariable(@NonNull java.lang.Class<T> type, @Nullable java.lang.String name, @Nullable AnnotationMetadata annotationMetadata, @Nullable Argument<?>... typeParameters)
T - The generic typetype - The typename - The nameannotationMetadata - The annotation metadatatypeParameters - the type parameters@NonNull static <T> Argument<T> ofTypeVariable(@NonNull java.lang.Class<T> type, @Nullable java.lang.String argumentName, @NonNull java.lang.String variableName, @Nullable AnnotationMetadata annotationMetadata, @Nullable Argument<?>... typeParameters)
T - The generic typetype - The typeargumentName - The name of the argumenntvariableName - The variable nameannotationMetadata - The annotation metadatatypeParameters - the type parameters@NonNull static <T> Argument<T> ofTypeVariable(@NonNull java.lang.Class<T> type, @Nullable java.lang.String name)
T - The generic typetype - The typename - The name@NonNull static <T> Argument<T> ofTypeVariable(@NonNull java.lang.Class<T> type, @Nullable java.lang.String argumentName, @NonNull java.lang.String variableName)
T - The generic typetype - The typeargumentName - The name of the argumentvariableName - The variable name@NonNull static <T> Argument<T> of(@NonNull java.lang.Class<T> type, @Nullable java.lang.String name, @Nullable 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(@NonNull java.lang.Class<T> type, @Nullable AnnotationMetadata annotationMetadata, @Nullable Argument<?>... typeParameters)
T - The generic typetype - The typeannotationMetadata - the annotation metadatatypeParameters - the type parameters@NonNull static <T> Argument<T> of(@NonNull java.lang.Class<T> type, @Nullable java.lang.String name)
T - The generic typetype - The typename - The name@NonNull static <T> Argument<T> of(@NonNull java.lang.Class<T> type, @Nullable Argument<?>... typeParameters)
T - The generic typetype - The typetypeParameters - The parameters type@NonNull static Argument<?> of(@NonNull java.lang.reflect.Type type)
Type instance to an Argument.type - The typejava.lang.IllegalArgumentException - If the type cannot be coerced@NonNull static <T> Argument<T> of(@NonNull java.lang.Class<T> type)
T - The generic typetype - The type@NonNull static <T> Argument<T> of(@NonNull java.lang.Class<T> type, @Nullable java.lang.Class<?>... typeParameters)
T - The generic typetype - The typetypeParameters - the parameters type@NonNull static <T> Argument<T> of(@NonNull java.lang.Class<T> type, @Nullable AnnotationMetadata annotationMetadata, @Nullable java.lang.Class<?>[] typeParameters)
T - The generic typetype - The typeannotationMetadata - The annotation metadatatypeParameters - The parameters type@NonNull static <T> Argument<java.util.List<T>> listOf(@NonNull java.lang.Class<T> type)
T - list element typetype - list element type@NonNull static <T> Argument<java.util.List<T>> listOf(@NonNull Argument<T> type)
T - list element typetype - list element type@NonNull static <T> Argument<java.util.Set<T>> setOf(@NonNull java.lang.Class<T> type)
T - set element typetype - set element type@NonNull static <T> Argument<java.util.Set<T>> setOf(@NonNull Argument<T> type)
T - set element typetype - set element type@NonNull static <K,V> Argument<java.util.Map<K,V>> mapOf(@NonNull java.lang.Class<K> keyType, @NonNull java.lang.Class<V> valueType)
K - The map key typeV - The map value typekeyType - The key typevalueType - The value type@NonNull static <K,V> Argument<java.util.Map<K,V>> mapOf(@NonNull Argument<K> keyType, @NonNull Argument<V> valueType)
K - The map key typeV - The map value typekeyType - The key typevalueType - The value type