T - The argument typepublic interface Argument<T> extends TypeVariableResolver, 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[] |
ZERO_ARGUMENTS
Constant representing zero arguments.
|
EMPTY| Modifier and Type | Method and Description |
|---|---|
default java.lang.reflect.ParameterizedType |
asParameterizedType()
Represent this argument as a
ParameterizedType. |
boolean |
equalsType(Argument<?> other)
Whether the types are equivalent.
|
java.lang.String |
getName() |
java.lang.Class<T> |
getType() |
default java.lang.String |
getTypeName() |
default java.lang.String |
getTypeString(boolean simple)
Returns the string representation of the argument type, including generics.
|
default boolean |
hasTypeVariables() |
default boolean |
isAsync() |
default boolean |
isAsyncOrReactive() |
default boolean |
isCompletable() |
default boolean |
isContainerType() |
default boolean |
isInstance(java.lang.Object o)
Whether the given argument is an instance.
|
default boolean |
isOptional() |
default boolean |
isReactive() |
default boolean |
isVoid()
Returns whether the return type is logically void.
|
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,
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 <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.
|
getFirstTypeVariable, getTypeParameters, getTypeVariable, getTypeVariablesisDeclaredNonNull, isDeclaredNullable, isNonNull, isNullablefindAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypegetAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotationstatic 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
@NonNull java.lang.String getName()
@NonNull default java.lang.String getTypeName()
getTypeName in interface java.lang.reflect.Type@NonNull java.lang.Class<T> getType()
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.@NonNull default java.lang.reflect.ParameterizedType asParameterizedType()
ParameterizedType.ParameterizedTypedefault boolean isInstance(@Nullable
java.lang.Object o)
o - The objectdefault java.lang.String getTypeString(boolean simple)
simple - If true, output the simple name of typesdefault boolean hasTypeVariables()
default boolean isContainerType()
default boolean isReactive()
default boolean isCompletable()
default boolean isAsync()
default boolean isOptional()
default boolean isAsyncOrReactive()
default boolean isVoid()
Completable)
and asynchronous types that emit Void.@NonNull static java.lang.Class[] toClassArray(Argument... arguments)
arguments - The arguments@NonNull static java.lang.String toString(Argument... arguments)
arguments - The arguments@NonNull static <T> Argument<T> of(java.lang.Class<T> type, java.lang.String name, @Nullable Argument... typeParameters)
T - The generic typetype - The typename - The nametypeParameters - the type parameters@NonNull static <T> Argument<T> of(java.lang.Class<T> type, java.lang.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(java.lang.Class<T> type, AnnotationMetadata annotationMetadata, @Nullable Argument... typeParameters)
T - The generic typetype - The typeannotationMetadata - the annotation metadatatypeParameters - the type parameters@NonNull static <T> Argument<T> of(java.lang.Class<T> type, java.lang.String name)
T - The generic typetype - The typename - The name@NonNull static <T> Argument<T> of(java.lang.Class<T> type, @Nullable Argument... typeParameters)
T - The generic typetype - The typetypeParameters - The parameters type@NonNull static <T> Argument<T> of(java.lang.Class<T> type)
T - The generic typetype - The type@NonNull static <T> Argument<T> of(java.lang.Class<T> type, @Nullable java.lang.Class<?>... typeParameters)
T - The generic typetype - The typetypeParameters - the parameters type@NonNull static <T> Argument<java.util.List<T>> listOf(java.lang.Class<T> type)
T - list element typetype - list element type@NonNull static <T> Argument<java.util.List<T>> listOf(Argument<T> type)
T - list element typetype - list element type@NonNull static <T> Argument<java.util.Set<T>> setOf(java.lang.Class<T> type)
T - set element typetype - set element type@NonNull static <T> Argument<java.util.Set<T>> setOf(Argument<T> type)
T - set element typetype - set element type@NonNull static <K,V> Argument<java.util.Map<K,V>> mapOf(java.lang.Class<K> keyType, 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(Argument<K> keyType, Argument<V> valueType)
K - The map key typeV - The map value typekeyType - The key typevalueType - The value type