Record Class BrowserSignal

java.lang.Object
java.lang.Record
com.shaft.capture.collector.BrowserSignal
Record Components:
kind - normalized low-level signal kind
timestamp - signal time
browsingContextId - BiDi or fallback browsing-context identifier
page - safe page fields captured with the signal
target - immediate element evidence
data - transient action data awaiting privacy classification

public record BrowserSignal(String kind, Instant timestamp, String browsingContextId, Map<String,Object> page, Map<String,Object> target, Map<String,Object> data) extends Record
Raw browser signal containing an immediate DOM snapshot but no persisted value.
  • Constructor Details

  • Method Details

    • fromJson

      public static BrowserSignal fromJson(String json, String browsingContextId)
      Parses a browser-side JSON signal.
      Parameters:
      json - signal JSON
      browsingContextId - source browsing context
      Returns:
      parsed signal
    • generated

      public static BrowserSignal generated(String kind, String contextId, Map<String,Object> page, Map<String,Object> data)
      Creates a recorder-generated signal.
      Parameters:
      kind - signal kind
      contextId - browsing context
      page - page fields
      data - action fields
      Returns:
      generated signal
    • dataString

      public String dataString(String key)
      Reads a string data field.
      Parameters:
      key - field name
      Returns:
      field value
    • dataInt

      public int dataInt(String key, int fallback)
      Reads an integer data field.
      Parameters:
      key - field name
      fallback - fallback value
      Returns:
      field value
    • dataBoolean

      public boolean dataBoolean(String key)
      Reads a boolean data field.
      Parameters:
      key - field name
      Returns:
      field value
    • dataStrings

      public List<String> dataStrings(String key)
      Reads a list data field as strings.
      Parameters:
      key - field name
      Returns:
      string list
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • kind

      public String kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • browsingContextId

      public String browsingContextId()
      Returns the value of the browsingContextId record component.
      Returns:
      the value of the browsingContextId record component
    • page

      public Map<String,Object> page()
      Returns the value of the page record component.
      Returns:
      the value of the page record component
    • target

      public Map<String,Object> target()
      Returns the value of the target record component.
      Returns:
      the value of the target record component
    • data

      public Map<String,Object> data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component