Interface ClassObject

All Superinterfaces:
HeapObject

public interface ClassObject extends HeapObject
Represents a java.lang.Class object in a heap dump. Provides access to static field values of the class it represents.
  • Method Details

    • representedClass

      @NotNull ClassDescriptor representedClass()
      Retrieves the ClassDescriptor that this ClassObject represents. The descriptor provides detailed metadata about the class, including its name, fields, and hierarchy.
      Returns:
      a ClassDescriptor instance representing the class described by this object, never null.
    • staticFieldValue

      @Nullable Object staticFieldValue(int fieldIndex)
      Retrieves the value of a static field for this class object based on its index. The static field can hold either a primitive value, a HeapObject, 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 null if no field exists at the specified index, if the static fields are unavailable, or if the field value itself is null.
    • staticFieldValue

      @Nullable Object staticFieldValue(String fieldName)
      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, a HeapObject, 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 null if no field exists with the specified name, if the static fields are unavailable, or if the field value itself is null.