Interface Instance

All Superinterfaces:
HeapObject
All Known Subinterfaces:
StringInstance

public interface Instance extends HeapObject
Represents an object instance from a heap dump. Instances provide access to the values of their fields.
  • Method Details

    • fieldValue

      @Nullable Object fieldValue(int fieldIndex)
      Retrieves the value of an instance field for this object based on its index in ClassDescriptor.allInstanceFields(). The field can hold either a primitive value, a HeapObject, or one of its subinterfaces.
      Parameters:
      fieldIndex - the zero-based index of the instance field. The index must be within the bounds of the fields defined for the object.
      Returns:
      the value of the instance field at the specified index, or null if no field exists with the specified index, if the field is unavailable, or if the field value itself is null.
    • fieldValue

      @Nullable Object fieldValue(String fieldName)
      Retrieves the value of an instance field for this object based on its name. The field can hold either a primitive value, a HeapObject, or one of its subinterfaces.
      Parameters:
      fieldName - the name of the instance field to be retrieved. Must not be null.
      Returns:
      the value of the instance field with the specified name, or null if no field exists with the specified name, if the field is unavailable, or if the field value itself is null.