Record Class ChartState

java.lang.Object
java.lang.Record
com.vaadin.flow.component.ai.chart.ChartState
Record Components:
queries - the SQL queries for the chart's data series
configuration - the chart configuration
All Implemented Interfaces:
Serializable

public record ChartState(List<String> queries, com.vaadin.flow.component.charts.model.Configuration configuration) extends Record implements Serializable
Serializable chart state for persistence across sessions. Captured via ChartAIController.getState() and restored via ChartAIController.restoreState(ChartState).
Author:
Vaadin Ltd
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChartState(List<String> queries, com.vaadin.flow.component.charts.model.Configuration configuration)
    Creates a new state instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.component.charts.model.Configuration
    Returns the value of the configuration record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the queries record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ChartState

      public ChartState(List<String> queries, com.vaadin.flow.component.charts.model.Configuration configuration)
      Creates a new state instance.
      Parameters:
      queries - the SQL queries, not null
      configuration - the chart configuration, not null
  • 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.
    • queries

      public List<String> queries()
      Returns the value of the queries record component.
      Returns:
      the value of the queries record component
    • configuration

      public com.vaadin.flow.component.charts.model.Configuration configuration()
      Returns the value of the configuration record component.
      Returns:
      the value of the configuration record component