getStaticObjectOrNullUntilSuperclassAs

fun <T> getStaticObjectOrNullUntilSuperclassAs(clazz: Class<*>, fieldName: String, untilSuperClass: Class<*>.() -> Boolean? = null): T?

Get the static object, and trying to cast to the T type

Return

field object or null

Parameters

clazz

class

fieldName

field name

untilSuperClass

until super class(true = break, false = continue), or null if find in all superclasses

Throws

if the field is not found