Interface ClassObject
- All Superinterfaces:
HeapObject
Represents a
java.lang.Class object in a heap dump. Provides
access to static field values of the class it represents.-
Method Summary
Modifier and TypeMethodDescriptionRetrieves theClassDescriptorthat thisClassObjectrepresents.staticFieldValue(int fieldIndex) Retrieves the value of a static field for this class object based on its index.staticFieldValue(String fieldName) Retrieves the value of a static field for this class object based on its field name.Methods inherited from interface HeapObject
classDescriptor, id, referencedObjects, referencingObjects, size
-
Method Details
-
representedClass
Retrieves theClassDescriptorthat thisClassObjectrepresents. The descriptor provides detailed metadata about the class, including its name, fields, and hierarchy.- Returns:
- a
ClassDescriptorinstance representing the class described by this object, never null.
-
staticFieldValue
Retrieves the value of a static field for this class object based on its index. The static field can hold either a primitive value, aHeapObject, or one of its subinterfaces.- Parameters:
fieldIndex- the zero-based index of the static field in the class descriptor. The index must be within the bounds of the static fields defined for the class.- Returns:
- the value of the static field at the specified index, or
nullif no field exists at the specified index, if the static fields are unavailable, or if the field value itself isnull.
-
staticFieldValue
Retrieves the value of a static field for this class object based on its field name. The static field can hold either a primitive value, aHeapObject, or one of its subinterfaces.- Parameters:
fieldName- the name of the static field to be retrieved. Must not be null or empty.- Returns:
- the value of the static field with the specified name, or
nullif no field exists with the specified name, if the static fields are unavailable, or if the field value itself isnull.
-