Package org.jboss.jandex
Class TypeVariable
java.lang.Object
org.jboss.jandex.Type
org.jboss.jandex.TypeVariable
Represents a resolved type parameter or type argument. The
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.- Author:
- Jason T. Greene
- Since:
- 2.0
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.jboss.jandex.Type
EMPTY_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionCasts this type to aTypeVariableand returns it if the kind isType.Kind.TYPE_VARIABLE.bounds()booleanCompares thisTypewith another type.inthashCode()Computes a hash code representing this type.The identifier of this type variable as it appears in Java source code.booleanintkind()Returns the kind of Type this is.name()Returns the raw name of this type.Methods inherited from class org.jboss.jandex.Type
annotation, annotations, annotationsWithRepeatable, asArrayType, asClassType, asParameterizedType, asPrimitiveType, asTypeVariableReference, asUnresolvedTypeVariable, asVoidType, asWildcardType, create, createWithAnnotations, hasAnnotation, toString
-
Method Details
-
name
Description copied from class:TypeReturns the raw name of this type. Primitives and void are returned as the Java keyword (void, boolean, byte, short, int, long, float, double, char). Arrays are returned using the Java reflection array syntax (e.g.[[[Ljava.lang.String;) Classes are returned as a normalDotName.Generic values are returned as the underlying raw value. For example, a wildcard such as
? extends Numberhas a raw type ofNumber. -
identifier
The identifier of this type variable as it appears in Java source code.The following class has a type parameter, with an identifier of "T":
class Foo<T extends Number> { }- Returns:
- the identifier of this type variable
-
bounds
-
kind
Description copied from class:TypeReturns the kind of Type this is. -
asTypeVariable
Description copied from class:TypeCasts this type to aTypeVariableand returns it if the kind isType.Kind.TYPE_VARIABLE. Throws an exception otherwise.- Overrides:
asTypeVariablein classType- Returns:
- a
TypeVariable
-
equals
Description copied from class:TypeCompares thisTypewith 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. -
hashCode
public int hashCode()Description copied from class:TypeComputes a hash code representing this type. -
internEquals
- Overrides:
internEqualsin classType
-
internHashCode
public int internHashCode()- Overrides:
internHashCodein classType
-