fieldValueAs

fun <T> Any.fieldValueAs(fieldName: String, type: Class<*>? = null): T?

读取实例字段值并转为指定类型。

Parameters

fieldName

字段名

type

可选字段类型,用于进一步确认匹配结果