Record Class ComponentState

java.lang.Object
java.lang.Record
com.vaadin.observability.micrometer.insights.ComponentState
Record Components:
component - fully-qualified class of the component holding the value
caption - what the component is called on screen; never null, because a value the reader cannot find on screen is not a step they can carry out
value - what it held, or null when it held nothing

public record ComponentState(@Nullable String component, String caption, @Nullable String value) extends Record
One value a view held when an interaction was captured: which component, as it is known on screen, and what was in it.

A failure is often not caused by the interaction that reports it but by the state it ran against: the returns desk blows up on "Process return" because the reason is "Defective", and a replay that only says "click the button" reproduces nothing. The state of the view, read at the moment the interaction was captured, is what makes a replay reproduce.

Collected in development mode only, since a caption and a value are application text that may carry user data; see ComponentCaptions.

  • Constructor Details

    • ComponentState

      public ComponentState(@Nullable String component, String caption, @Nullable String value)
      Creates an instance of a ComponentState record class.
      Parameters:
      component - the value for the component record component
      caption - the value for the caption record component
      value - the value for the value record component
  • 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. 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.
    • component

      public @Nullable String component()
      Returns the value of the component record component.
      Returns:
      the value of the component record component
    • caption

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

      public @Nullable String value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component