findField

@Nullable
open fun findField(clazz: Class<out Any>, name: String): @Nullable Field

Attempt to find a field on the supplied Class with the supplied name. Searches all superclasses up to Object.

Return

the corresponding Field object, or null if not found

Parameters

clazz

the class to introspect

name

the name of the field


@Nullable
open fun findField(clazz: Class<out Any>, @Nullable name: @Nullable String, @Nullable type: @Nullable Class<out Any>): @Nullable Field

Attempt to find a field on the supplied Class with the supplied name and/or type. Searches all superclasses up to Object.

Return

the corresponding Field object, or null if not found

Parameters

clazz

the class to introspect

name

the name of the field (may be null if type is specified)

type

the type of the field (may be null if name is specified)