# GenericDeclaration

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Methods](https://developer.android.com/reference/java/lang/reflect/GenericDeclaration#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/java/lang/reflect/GenericDeclaration#inhmethods)  

# GenericDeclaration

`
public


interface
GenericDeclaration
`  
`


implements

`[AnnotatedElement](https://developer.android.com/reference/java/lang/reflect/AnnotatedElement)`


`

|--------------------------------------|
| java.lang.reflect.GenericDeclaration |

|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known indirect subclasses [Class](https://developer.android.com/reference/java/lang/Class)\<T\>,[Constructor](https://developer.android.com/reference/java/lang/reflect/Constructor)\<T\>,[Executable](https://developer.android.com/reference/java/lang/reflect/Executable),[Method](https://developer.android.com/reference/java/lang/reflect/Method) |-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Class](https://developer.android.com/reference/java/lang/Class)\<T\>                     | Instances of the class`Class`represent classes and interfaces in a running Java application.                                                                                                                          | | [Constructor](https://developer.android.com/reference/java/lang/reflect/Constructor)\<T\> | `Constructor`provides information about, and access to, a single constructor for a class.                                                                                                                             | | [Executable](https://developer.android.com/reference/java/lang/reflect/Executable)        | A shared superclass for the common functionality of[Method](https://developer.android.com/reference/java/lang/reflect/Method)and[Constructor](https://developer.android.com/reference/java/lang/reflect/Constructor). | | [Method](https://developer.android.com/reference/java/lang/reflect/Method)                | A`Method`provides information about, and access to, a single method on a class or interface.                                                                                                                          | |

<br />

*** ** * ** ***

A common interface for all entities that declare type variables.

## Summary

|                                                                                                                                                                                                      ### Public methods                                                                                                                                                                                                      ||
|-----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract `[TypeVariable[]](https://developer.android.com/reference/java/lang/reflect/TypeVariable)`<?>` | ` `[getTypeParameters](https://developer.android.com/reference/java/lang/reflect/GenericDeclaration#getTypeParameters())`() ` Returns an array of`TypeVariable`objects that represent the type variables declared by the generic declaration represented by this`GenericDeclaration`object, in declaration order. |

| ### Inherited methods |
|-----------------------|---|
| From interface` `[java.lang.reflect.AnnotatedElement](https://developer.android.com/reference/java/lang/reflect/AnnotatedElement)` ` |--------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract <T extends `[Annotation](https://developer.android.com/reference/java/lang/annotation/Annotation)`> T`  | ` `[getAnnotation](https://developer.android.com/reference/java/lang/reflect/AnnotatedElement#getAnnotation(java.lang.Class<T>))`(`[Class](https://developer.android.com/reference/java/lang/Class)`<T> annotationClass) ` Returns this element's annotation for the specified type if such an annotation is*present*, else null.                                                                                                                                               | | ` abstract `[Annotation[]](https://developer.android.com/reference/java/lang/annotation/Annotation)                | ` `[getAnnotations](https://developer.android.com/reference/java/lang/reflect/AnnotatedElement#getAnnotations())`() ` Returns annotations that are*present*on this element.                                                                                                                                                                                                                                                                                                     | | ` default <T extends `[Annotation](https://developer.android.com/reference/java/lang/annotation/Annotation)`> T[]` | ` `[getAnnotationsByType](https://developer.android.com/reference/java/lang/reflect/AnnotatedElement#getAnnotationsByType(java.lang.Class<T>))`(`[Class](https://developer.android.com/reference/java/lang/Class)`<T> annotationClass) ` Returns annotations that are*associated*with this element.                                                                                                                                                                             | | ` default <T extends `[Annotation](https://developer.android.com/reference/java/lang/annotation/Annotation)`> T`   | ` `[getDeclaredAnnotation](https://developer.android.com/reference/java/lang/reflect/AnnotatedElement#getDeclaredAnnotation(java.lang.Class<T>))`(`[Class](https://developer.android.com/reference/java/lang/Class)`<T> annotationClass) ` Returns this element's annotation for the specified type if such an annotation is*directly present*, else null.                                                                                                                      | | ` abstract `[Annotation[]](https://developer.android.com/reference/java/lang/annotation/Annotation)                | ` `[getDeclaredAnnotations](https://developer.android.com/reference/java/lang/reflect/AnnotatedElement#getDeclaredAnnotations())`() ` Returns annotations that are*directly present*on this element.                                                                                                                                                                                                                                                                            | | ` default <T extends `[Annotation](https://developer.android.com/reference/java/lang/annotation/Annotation)`> T[]` | ` `[getDeclaredAnnotationsByType](https://developer.android.com/reference/java/lang/reflect/AnnotatedElement#getDeclaredAnnotationsByType(java.lang.Class<T>))`(`[Class](https://developer.android.com/reference/java/lang/Class)`<T> annotationClass) ` Returns this element's annotation(s) for the specified type if such annotations are either*directly present* or*indirectly present*.                                                                                   | | ` default boolean`                                                                                                 | ` `[isAnnotationPresent](https://developer.android.com/reference/java/lang/reflect/AnnotatedElement#isAnnotationPresent(java.lang.Class<?%20extends%20java.lang.annotation.Annotation>))`(`[Class](https://developer.android.com/reference/java/lang/Class)`<? extends `[Annotation](https://developer.android.com/reference/java/lang/annotation/Annotation)`> annotationClass) ` Returns true if an annotation for the specified type is*present*on this element, else false. | ||

## Public methods

### getTypeParameters

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract TypeVariable[]<?> getTypeParameters ()
```

Returns an array of`TypeVariable`objects that represent the type variables declared by the generic declaration represented by this`GenericDeclaration`object, in declaration order. Returns an array of length 0 if the underlying generic declaration declares no type variables.

<br />

|                                                                                                    Returns                                                                                                    ||
|-----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|
| [TypeVariable[]](https://developer.android.com/reference/java/lang/reflect/TypeVariable)`<?>` | an array of`TypeVariable`objects that represent the type variables declared by this generic declaration <br /> |

|                                                                                                                            Throws                                                                                                                             ||
|----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| [GenericSignatureFormatError](https://developer.android.com/reference/java/lang/reflect/GenericSignatureFormatError) | if the generic signature of this generic declaration does not conform to the format specified inThe Java™ Virtual Machine Specification |