Interface TypeVariable
-
- 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.Objectand 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 TypeVariableasTypeVariable()Returns this type as a type variable.List<Type>bounds()Returns the bounds declared for this type variable.default Type.Kindkind()Returns the kind of this type.Stringname()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
String name()
Returns the name of this type variable.- Returns:
- the name of this type variable, never
null
-
bounds
List<Type> bounds()
Returns the bounds declared for this type variable.- Returns:
- the bounds declared for this type variable, never
nullor empty
-
kind
default Type.Kind kind()
Description copied from interface:TypeReturns the kind of this type.
-
asTypeVariable
default TypeVariable asTypeVariable()
Description copied from interface:TypeReturns this type as a type variable. Type variables are also used to represent type parameters in declarations of parameterized types.- Specified by:
asTypeVariablein interfaceType- Returns:
- this type variable, never
null
-
-