Skip to content
🤔 Documentation issue? Report it

//leakcanary-repo/shark/HeapObject/HeapInstance/readField

readField

[jvm]\ fun readField(declaringClass: KClass<out Any>, fieldName: String): HeapField?

See also

HeapObject.HeapInstance.readField

[jvm]\ fun readField(declaringClassName: String, fieldName: String): HeapField?

Returns a HeapField object that reflects the specified declared field of the instance represented by this HeapInstance object, or null if this field does not exist. The declaringClassName specifies the class in which the desired field is declared, and the fieldName parameter specifies the simple name of the desired field.

Also available as a convenience operator: get

This may trigger IO reads.