getAnnotation

abstract fun <A : Annotation> getAnnotation(annotationClass: Class<A>): A?

Retrieves an annotation of the specified type from the function's metadata.

Return

the annotation instance if present, null otherwise

Parameters

annotationClass

the class of the annotation to retrieve