getAnnotation

inline fun <T : Annotation> getAnnotation(): 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> getAnnotation(annotationClass: KClass<T>): Annotation?
fun <T : Annotation> getAnnotation(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.