Interface TypeVariable
- All Superinterfaces:
AnnotationTarget
,Type
Type variables represent type parameters declared on generic classes or methods.
All type variables have bounds. A type variable with no bound declared is equivalent to
a type variable with a single bound of
java.lang.Object
and is represented as such.
If one bound is declared, it is a type variable or a class type, possibly parameterized.
If more than one bound is declared, the first bound is a class type or an interface type,
possibly parameterized, and the following bounds are interface types, possibly parameterized.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault TypeVariable
Returns this type as a type variable.bounds()
Returns the bounds declared for this type variable.default Type.Kind
kind()
Returns the kind of this type.name()
Returns the name of this type variable.Methods inherited from interface jakarta.enterprise.lang.model.AnnotationTarget
annotation, annotations, annotations, hasAnnotation, hasAnnotation, repeatableAnnotation
Methods inherited from interface jakarta.enterprise.lang.model.types.Type
asArray, asClass, asDeclaration, asParameterizedType, asPrimitive, asType, asVoid, asWildcardType, isArray, isClass, isDeclaration, isParameterizedType, isPrimitive, isType, isTypeVariable, isVoid, isWildcardType
-
Method Details
-
name
String name()Returns the name of this type variable.- Returns:
- the name of this type variable, never
null
-
bounds
Returns the bounds declared for this type variable.- Returns:
- the bounds declared for this type variable, never
null
or empty
-
kind
Description copied from interface:Type
Returns the kind of this type. -
asTypeVariable
Description copied from interface:Type
Returns this type as a type variable. Type variables are also used to represent type parameters in declarations of parameterized types.- Specified by:
asTypeVariable
in interfaceType
- Returns:
- this type variable, never
null
-