getDeclaredAnnotation

inline fun <T : Annotation> getDeclaredAnnotation(): Annotation?

Finds an Annotation of the selected T type.

Return

an instance of T wrapped in Annotation or null if the javaClass is not annotated.


fun <T : Annotation> getDeclaredAnnotation(annotationClass: KClass<T>): Annotation?
fun <T : Annotation> getDeclaredAnnotation(annotationClass: Class<T>): Annotation?

Finds an Annotation of the selected T type.

Return

an instance of T wrapped in Annotation or null if the javaClass is not annotated.

Parameters

annotationClass

type of the annotation to search for.