Record Class ElementSnapshot

java.lang.Object
java.lang.Record
com.shaft.capture.model.ElementSnapshot
Record Components:
logicalElementId - stable logical element identifier
tagName - element tag name
role - accessible role
accessibleName - sanitized accessible name
label - sanitized associated label
normalizedAttributes - sanitized normalized attributes
locatorCandidates - deterministic locator evidence
visible - whether the element was visible
enabled - whether the element was enabled
selected - whether the element was selected

public record ElementSnapshot(String logicalElementId, String tagName, String role, String accessibleName, String label, Map<String,String> normalizedAttributes, List<LocatorCandidate> locatorCandidates, boolean visible, boolean enabled, boolean selected) extends Record
Sanitized element evidence at the time of an action.
  • Constructor Details

    • ElementSnapshot

      public ElementSnapshot(String logicalElementId, String tagName, String role, String accessibleName, String label, Map<String,String> normalizedAttributes, List<LocatorCandidate> locatorCandidates, boolean visible, boolean enabled, boolean selected)
      Creates an immutable element snapshot with candidates in best-first order.
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • logicalElementId

      public String logicalElementId()
      Returns the value of the logicalElementId record component.
      Returns:
      the value of the logicalElementId record component
    • tagName

      public String tagName()
      Returns the value of the tagName record component.
      Returns:
      the value of the tagName record component
    • role

      public String role()
      Returns the value of the role record component.
      Returns:
      the value of the role record component
    • accessibleName

      public String accessibleName()
      Returns the value of the accessibleName record component.
      Returns:
      the value of the accessibleName record component
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • normalizedAttributes

      public Map<String,String> normalizedAttributes()
      Returns the value of the normalizedAttributes record component.
      Returns:
      the value of the normalizedAttributes record component
    • locatorCandidates

      public List<LocatorCandidate> locatorCandidates()
      Returns the value of the locatorCandidates record component.
      Returns:
      the value of the locatorCandidates record component
    • visible

      public boolean visible()
      Returns the value of the visible record component.
      Returns:
      the value of the visible record component
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • selected

      public boolean selected()
      Returns the value of the selected record component.
      Returns:
      the value of the selected record component