Record Class GrowingViewState

java.lang.Object
java.lang.Record
com.vaadin.observability.micrometer.insights.GrowingViewState
Record Components:
viewClass - fully qualified class name of the view
field - the field, as DeclaringClass.fieldName with the declaring class fully qualified
route - the view's route template, or null when it has none
elements - elements held at the latest measurement
firstElements - elements held when the run of growth began
growthSamples - measurements at which the collection had grown, since it last shrank or was first seen
firstSeen - when the run of growth began
lastGrew - the latest measurement that found it grown
sessionId - the session, hashed unless insight details are enabled
uiId - the UI within the session

public record GrowingViewState(String viewClass, String field, @Nullable String route, int elements, int firstElements, int growthSamples, Instant firstSeen, Instant lastGrew, @Nullable String sessionId, int uiId) extends Record
A collection one view instance keeps in a field, which has grown at every measurement of its UI that saw it change — the shape of a view accumulating what it loads instead of replacing it.
  • Constructor Details

    • GrowingViewState

      public GrowingViewState(String viewClass, String field, @Nullable String route, int elements, int firstElements, int growthSamples, Instant firstSeen, Instant lastGrew, @Nullable String sessionId, int uiId)
      Creates an instance of a GrowingViewState record class.
      Parameters:
      viewClass - the value for the viewClass record component
      field - the value for the field record component
      route - the value for the route record component
      elements - the value for the elements record component
      firstElements - the value for the firstElements record component
      growthSamples - the value for the growthSamples record component
      firstSeen - the value for the firstSeen record component
      lastGrew - the value for the lastGrew record component
      sessionId - the value for the sessionId record component
      uiId - the value for the uiId record component
  • Method Details

    • sessionIdOf

      public static @Nullable String sessionIdOf(@Nullable com.vaadin.flow.component.UI ui, boolean details)
      The session id to report for a UI: reduced to a short one-way hash unless detail is enabled, as for every other insight.
      Parameters:
      ui - the UI, may be null
      details - whether the application opted in to sensitive detail
      Returns:
      the raw or hashed session id, or null when there is none
    • 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 '=='.
      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.
    • viewClass

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

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

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

      public int elements()
      Returns the value of the elements record component.
      Returns:
      the value of the elements record component
    • firstElements

      public int firstElements()
      Returns the value of the firstElements record component.
      Returns:
      the value of the firstElements record component
    • growthSamples

      public int growthSamples()
      Returns the value of the growthSamples record component.
      Returns:
      the value of the growthSamples record component
    • firstSeen

      public Instant firstSeen()
      Returns the value of the firstSeen record component.
      Returns:
      the value of the firstSeen record component
    • lastGrew

      public Instant lastGrew()
      Returns the value of the lastGrew record component.
      Returns:
      the value of the lastGrew record component
    • sessionId

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

      public int uiId()
      Returns the value of the uiId record component.
      Returns:
      the value of the uiId record component