public final class TypeVariable extends Type
name() of this type variable
corresponds to the raw type name. For type variables, the raw type name is the first upper bound. The
identifier() is the name of the type variable as present in the source code.
For example:
T extends NumberIn this case, the identifier is
T, while the name is java.lang.Number.EMPTY_ARRAY| Modifier and Type | Method and Description |
|---|---|
static boolean |
arrayEquals(org.jboss.jandex.Interned[] a,
org.jboss.jandex.Interned[] b) |
static int |
arrayHashCode(org.jboss.jandex.Interned[] array) |
TypeVariable |
asTypeVariable()
Casts this type to a
TypeVariable and returns it if the kind is
Type.Kind.TYPE_VARIABLE. |
List<Type> |
bounds() |
boolean |
equals(Object o)
Compares this
Type with another type. |
int |
hashCode()
Computes a hash code representing this type.
|
String |
identifier()
The identifier of this type variable as it appears in Java source code.
|
boolean |
internEquals(Object o) |
int |
internHashCode() |
Type.Kind |
kind()
Returns the kind of Type this is.
|
DotName |
name()
Returns the raw name of this type.
|
annotation, annotations, annotationsWithRepeatable, asArrayType, asClassType, asParameterizedType, asPrimitiveType, asTypeVariableReference, asUnresolvedTypeVariable, asVoidType, asWildcardType, create, createWithAnnotations, hasAnnotation, toStringpublic DotName name()
Type[[[Ljava.lang.String;) Classes are returned as a normal DotName.
Generic values are returned as the underlying raw value. For example,
a wildcard such as ? extends Number has a raw type of
Number.
public String identifier()
The following class has a type parameter, with an identifier of "T":
class Foo<T extends Number> {
}
public TypeVariable asTypeVariable()
TypeTypeVariable and returns it if the kind is
Type.Kind.TYPE_VARIABLE. Throws an exception otherwise.asTypeVariable in class TypeTypeVariablepublic boolean equals(Object o)
TypeType with another type. A type is equal to another type
if it is of the same kind, and all of their fields are equal. This includes
annotations, which must be equal as well.equals in class Typeo - the type to compare toObject.equals(Object)public int hashCode()
Typepublic boolean internEquals(Object o)
internEquals in class Typepublic int internHashCode()
internHashCode in class Typepublic static boolean arrayEquals(org.jboss.jandex.Interned[] a,
org.jboss.jandex.Interned[] b)
public static int arrayHashCode(org.jboss.jandex.Interned[] array)
Copyright © 2018–2022. All rights reserved.