findFieldByTypeOrNull

fun Class<*>.findFieldByTypeOrNull(type: Class<*>, findSuper: Boolean? = null): Field?

按字段类型查找字段,找不到时返回 null

Parameters

type

字段类型

findSuper

null 为智能查找,false 只查当前类,true 查当前类和全部父类