-
- All Superinterfaces:
AnnotationTarget
,Type
public interface TypeVariable extends 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 ofjava.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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default TypeVariable
asTypeVariable()
Returns this type as a type variable.java.util.List<Type>
bounds()
Returns the bounds declared for this type variable.default Type.Kind
kind()
Returns the kind of this type.java.lang.String
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 Detail
-
name
java.lang.String name()
Returns the name of this type variable.- Returns:
- the name of this type variable, never
null
-
bounds
java.util.List<Type> bounds()
Returns the bounds declared for this type variable.- Returns:
- the bounds declared for this type variable, never
null
or empty
-
kind
default Type.Kind kind()
Description copied from interface:Type
Returns the kind of this type.
-
asTypeVariable
default TypeVariable 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
-
-