public class TypeParameterBoundTypeTarget extends TypeParameterTypeTarget
Consider the following example involving a type target using the "Bar" annotation:
public <T extends Number & @Bar Serializable> void foo(List<T>) { ... }
This example would be represented as a TypeParameterBoundTypeTarget with
an enclosing target of foo's MethodInfo, a position() value of "0"
and a boundPosition() value of "1". The "Bar" annotation would appear on the
type "Serializable" in the bound list of T, on the first type parameter.
TypeTarget.UsageAnnotationTarget.Kind| Modifier and Type | Field and Description |
|---|---|
private int |
boundPosition |
| Constructor and Description |
|---|
TypeParameterBoundTypeTarget(AnnotationTarget enclosingTarget,
int position,
int boundPosition) |
TypeParameterBoundTypeTarget(AnnotationTarget enclosingTarget,
Type target,
int position,
int boundPosition) |
| Modifier and Type | Method and Description |
|---|---|
TypeParameterBoundTypeTarget |
asTypeParameterBound()
Casts and returns this type target as a
TypeParameterBoundTypeTarget. |
int |
boundPosition()
Returns the index of the bound this type annotation is within.
|
TypeTarget.Usage |
usage()
Returns the kind of usage of this type target.
|
asTypeParameterpositionasClass, asClassExtends, asEmpty, asField, asMethod, asMethodParameter, asMethodParameterType, asThrows, asType, enclosingTarget, kind, setTarget, targetTypeParameterBoundTypeTarget(AnnotationTarget enclosingTarget, int position, int boundPosition)
TypeParameterBoundTypeTarget(AnnotationTarget enclosingTarget, Type target, int position, int boundPosition)
public final int boundPosition()
public final TypeTarget.Usage usage()
TypeTargetgetClass() comparisons.usage in class TypeParameterTypeTargetpublic TypeParameterBoundTypeTarget asTypeParameterBound()
TypeTargetTypeParameterBoundTypeTarget. If this type target
is not a TypeParameterBoundTypeTarget, then an exception will be thrown.asTypeParameterBound in class TypeTargetTypeParameterBoundTypeTarget