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> l) { ... }
This example would be represented as a TypeParameterBoundTypeTarget with an enclosing target
of the MethodInfo of foo, position() would be 0 and boundPosition() would be 1.
TypeTarget.UsageAnnotationTarget.Kind| 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.
|
asTypeParameterpositionannotation, annotations, annotations, annotationsWithRepeatable, asClass, asClassExtends, asEmpty, asField, asMethod, asMethodParameter, asMethodParameterType, asRecordComponent, asThrows, asType, declaredAnnotation, declaredAnnotations, declaredAnnotationsWithRepeatable, enclosingTarget, hasAnnotation, hasDeclaredAnnotation, kind, targetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitannotation, annotation, annotations, annotations, annotationsWithRepeatable, annotationsWithRepeatable, declaredAnnotation, declaredAnnotation, declaredAnnotationsWithRepeatable, declaredAnnotationsWithRepeatable, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotationpublic 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 TypeTargetTypeParameterBoundTypeTargetCopyright © 2018–2022. All rights reserved.