Record Class DatasetColumn

java.lang.Object
java.lang.Record
com.axelor.meta.query.dataset.DatasetColumn
Record Components:
name - the exact record key
title - display title
type - scalar type as declared by the query
aggregate - the method behind this measure, or null when the column is not aggregated
format - how values in this column are presented
currency - ISO currency code for a currency column
currencyField - the column holding each row's currency code, for amounts in several currencies, which a consumer never adds together
scale - what a percentage column's stored number means
selection - the selection the column's values are shown with
options - that selection's options, so a consumer shows a stored value by its title

public record DatasetColumn(String name, String title, String type, AggregateFn aggregate, FormatType format, String currency, String currencyField, FormatScale scale, String selection, List<DatasetOption> options) extends Record
One result column's identity, type and presentation metadata.

aggregate is populated from the query's own <select fn=>, so a consumer knows a measure's method rather than guessing it from the values. A pivot needs this to refuse to average averages.

  • Constructor Details

    • DatasetColumn

      public DatasetColumn(String name, String title, String type, AggregateFn aggregate, FormatType format, String currency, String currencyField, FormatScale scale, String selection, List<DatasetOption> options)
      Creates an instance of a DatasetColumn record class.
      Parameters:
      name - the value for the name record component
      title - the value for the title record component
      type - the value for the type record component
      aggregate - the value for the aggregate record component
      format - the value for the format record component
      currency - the value for the currency record component
      currencyField - the value for the currencyField record component
      scale - the value for the scale record component
      selection - the value for the selection record component
      options - the value for the options 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.
    • name

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

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

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

      public AggregateFn aggregate()
      Returns the value of the aggregate record component.
      Returns:
      the value of the aggregate record component
    • format

      public FormatType format()
      Returns the value of the format record component.
      Returns:
      the value of the format record component
    • currency

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

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

      public FormatScale scale()
      Returns the value of the scale record component.
      Returns:
      the value of the scale record component
    • selection

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

      public List<DatasetOption> options()
      Returns the value of the options record component.
      Returns:
      the value of the options record component