java.lang.reflect.TypeVariable interface
for core reflection.
| Modifier and Type | Field and Description |
|---|---|
| private volatile Object[] | bounds
The upper bounds. |
| private final D | |
| private final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object o)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public AnnotatedType[] | getAnnotatedBounds()
Implements java. Returns an array of AnnotatedType objects that represent the use of types to denote the upper bounds of the type parameter represented by this TypeVariable. |
| public <T extends Annotation> T | getAnnotation(Class<T> annotationClass)
Implements java. Returns this element's annotation for the specified type if such an annotation is present, else null. |
| public Annotation[] | getAnnotations()
Implements java. Returns annotations that are present on this element. |
| public <T extends Annotation> T[] | getAnnotationsByType(Class<T> annotationClass)
Overrides default java. Returns annotations that are associated with this element. |
| public Type[] | Returns: an array of Types representing the upper bound(s) of this type variableImplements java. Returns an array of |
| public <T extends Annotation> T | getDeclaredAnnotation(Class<T> annotationClass)
Overrides default java. Returns this element's annotation for the specified type if such an annotation is directly present, else null. |
| public Annotation[] | getDeclaredAnnotations()
Implements java. Returns annotations that are directly present on this element. |
| public <T extends Annotation> T[] | getDeclaredAnnotationsByType(Class<T> annotationClass)
Overrides default java. Returns this element's annotation(s) for the specified type if such annotations are either directly present or indirectly present. |
| public D | Returns: a generic declaration that declared this type variable.Implements java. Returns a |
| public String | Returns: the name of this type variable, as it appears in the source codeImplements java. Returns the name of this type variable, as it occurs in the source code. |
| public int | |
| public static <T extends GenericDeclaration> TypeVariableImpl | Returns: A type variable with name, bounds, declaration and factory specified- the reflective object that declared the type variable
that this method should create decl, String - the name of the type variable to be returned name, FieldTypeSignature[] - an array of ASTs representing the bounds for the type
variable to be created bs, GenericsFactory - a factory that can be used to manufacture reflective
objects that represent the bounds of this type variable f)Factory method. |
| private static Map | |
| public String | |
| private int |
| bounds | back to summary |
|---|---|
| private volatile Object[] bounds The upper bounds. Lazily converted from FieldTypeSignature[] to Type[]. We are required to evaluate the bounds lazily, so we store them as ASTs until we are first asked for them. This also neatly solves the problem with F-bounds - you can't reify them before the formal is defined. | |
| genericDeclaration | back to summary |
|---|---|
| private final D genericDeclaration | |
| name | back to summary |
|---|---|
| private final String name | |
| TypeVariableImpl | back to summary |
|---|---|
| private TypeVariableImpl(D decl, String n, FieldTypeSignature[] bs, GenericsFactory f) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getAnnotatedBounds | back to summary |
|---|---|
| public AnnotatedType[] getAnnotatedBounds() Implements java. Doc from java. Returns an array of AnnotatedType objects that represent the use of
types to denote the upper bounds of the type parameter represented by
this TypeVariable. The order of the objects in the array corresponds to
the order of the bounds in the declaration of the type parameter. Note that
if no upper bound is explicitly declared, the upper bound is unannotated
| |
| getAnnotation | back to summary |
|---|---|
| public <T extends Annotation> T getAnnotation(Class<T> annotationClass) Implements java. Doc from java. Returns this element's annotation for the specified type if such an annotation is present, else null.
| |
| getAnnotations | back to summary |
|---|---|
| public Annotation[] getAnnotations() Implements java. Doc from java. Returns annotations that are present on this element. If there are no annotations present on this element, the return value is an array of length 0. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers. | |
| getAnnotationsByType | back to summary |
|---|---|
| public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) Overrides default java. Doc from java. Returns annotations that are associated with this element.
If there are no annotations associated with this element, the return
value is an array of length 0.
The difference between this method and
| |
| getBounds | back to summary |
|---|---|
| public Type[] getBounds() Implements java. Returns an array of For each upper bound B:
| |
| getDeclaredAnnotation | back to summary |
|---|---|
| public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass) Overrides default java. Doc from java. Returns this element's annotation for the specified type if such an annotation is directly present, else null. This method ignores inherited annotations. (Returns null if no annotations are directly present on this element.) | |
| getDeclaredAnnotations | back to summary |
|---|---|
| public Annotation[] getDeclaredAnnotations() Implements java. Doc from java. Returns annotations that are directly present on this element. This method ignores inherited annotations. If there are no annotations directly present on this element, the return value is an array of length 0. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers. | |
| getDeclaredAnnotationsByType | back to summary |
|---|---|
| public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass) Overrides default java. Doc from java. Returns this element's annotation(s) for the specified type if
such annotations are either directly present or
indirectly present. This method ignores inherited
annotations.
If there are no specified annotations directly or indirectly
present on this element, the return value is an array of length
0.
The difference between this method and
| |
| getGenericDeclaration | back to summary |
|---|---|
| public D getGenericDeclaration() Implements java. Returns a
| |
| getName | back to summary |
|---|---|
| public String getName() Implements java. Returns the name of this type variable, as it occurs in the source code.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| make | back to summary |
|---|---|
| public static <T extends GenericDeclaration> TypeVariableImpl Factory method.
| |
| mapAnnotations | back to summary |
|---|---|
| private static Map | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| typeVarIndex | back to summary |
|---|---|
| private int typeVarIndex() | |