getDeclarationAs

fun <T : Declaration?> getDeclarationAs(i: Int, clazz: Class<T>): T?

Returns the i-th declaration as a specific class, if it can be cast

Return

the declaration or null, if it can not be cast to the class

Parameters

i

the index

clazz

the class

the type of the class