Record Class DataSourceController.QueryResponse

java.lang.Object
java.lang.Record
io.micronaut.controlpanel.panels.datasource.DataSourceController.QueryResponse
Record Components:
draw - DataTables draw counter (echoed)
recordsTotal - Total number of rows
recordsFiltered - Total number of rows after filtering (same as total)
data - Page rows (arrays of strings)
cols - Column labels used to render headers
error - Optional error message
Enclosing class:
DataSourceController

public static record DataSourceController.QueryResponse(Integer draw, int recordsTotal, int recordsFiltered, List<List<String>> data, List<String> cols, String error) extends Record
Response DTO matching DataTables server-side structure with extra cols.
Since:
2.0.0
Author:
Álvaro Sánchez-Mariscal
  • Constructor Details

    • QueryResponse

      public QueryResponse(Integer draw, int recordsTotal, int recordsFiltered, List<List<String>> data, List<String> cols, String error)
      Creates an instance of a QueryResponse record class.
      Parameters:
      draw - the value for the draw record component
      recordsTotal - the value for the recordsTotal record component
      recordsFiltered - the value for the recordsFiltered record component
      data - the value for the data record component
      cols - the value for the cols record component
      error - the value for the error 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. 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.
    • draw

      public Integer draw()
      Returns the value of the draw record component.
      Returns:
      the value of the draw record component
    • recordsTotal

      public int recordsTotal()
      Returns the value of the recordsTotal record component.
      Returns:
      the value of the recordsTotal record component
    • recordsFiltered

      public int recordsFiltered()
      Returns the value of the recordsFiltered record component.
      Returns:
      the value of the recordsFiltered record component
    • data

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

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

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