Record Class StatsFieldDescriptor

java.lang.Object
java.lang.Record
org.praxisplatform.uischema.stats.StatsFieldDescriptor
Record Components:
field - campo canonico exposto pela API
propertyPath - caminho de propriedade usado nas agregacoes internas
metrics - metricas agregadas permitidas para o campo
groupByEligible - indica se o campo pode ser usado como bucket de group-by
timeSeriesEligible - indica se o campo pode ser usado como eixo temporal
distributionTermsEligible - indica se o campo pode ser usado em distribuicao por termos
distributionHistogramEligible - indica se o campo pode ser usado em distribuicao por histograma
metricFieldEligible - indica se o campo pode ser usado como metric.field

public record StatsFieldDescriptor(String field, String propertyPath, Set<StatsMetric> metrics, boolean groupByEligible, boolean timeSeriesEligible, boolean distributionTermsEligible, boolean distributionHistogramEligible, boolean metricFieldEligible) extends Record
Descreve um campo elegivel para stats filtrados.

O descritor conecta o nome canonico exposto na API ao propertyPath usado internamente nas agregacoes, e declara em quais superficies estatisticas o campo pode aparecer: buckets, eixo temporal, distribuicao ou campo de metrica.

  • Constructor Details

    • StatsFieldDescriptor

      public StatsFieldDescriptor(String field, String propertyPath, Set<StatsMetric> metrics, boolean groupByEligible, boolean timeSeriesEligible, boolean distributionTermsEligible, boolean distributionHistogramEligible, boolean metricFieldEligible)
      Normaliza a colecao de metricas para um conjunto imutavel.
    • StatsFieldDescriptor

      public StatsFieldDescriptor(String field, String propertyPath, Set<StatsMetric> metrics)
  • Method Details

    • groupByBucket

      public static StatsFieldDescriptor groupByBucket(String field, String propertyPath, Set<StatsMetric> metrics)
    • timeSeriesField

      public static StatsFieldDescriptor timeSeriesField(String field, String propertyPath)
    • metricField

      public static StatsFieldDescriptor metricField(String field, String propertyPath, Set<StatsMetric> metrics)
    • histogramField

      public static StatsFieldDescriptor histogramField(String field, String propertyPath, Set<StatsMetric> metrics)
    • distributionTermsBucket

      public static StatsFieldDescriptor distributionTermsBucket(String field, String propertyPath, Set<StatsMetric> metrics)
    • categoricalGroupByBucket

      public static StatsFieldDescriptor categoricalGroupByBucket(String field, String propertyPath)
    • categoricalTermsBucket

      public static StatsFieldDescriptor categoricalTermsBucket(String field, String propertyPath)
    • temporalTimeSeriesField

      public static StatsFieldDescriptor temporalTimeSeriesField(String field, String propertyPath)
    • numericMeasureField

      public static StatsFieldDescriptor numericMeasureField(String field, String propertyPath)
    • numericHistogramMeasureField

      public static StatsFieldDescriptor numericHistogramMeasureField(String field, String propertyPath)
    • supports

      public boolean supports(StatsMetric metric)
      Verifica se o campo suporta a metrica agregada informada.
      Parameters:
      metric - metrica desejada
      Returns:
      true quando a metrica estiver habilitada no descritor
    • 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.
    • field

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

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

      public Set<StatsMetric> metrics()
      Returns the value of the metrics record component.
      Returns:
      the value of the metrics record component
    • groupByEligible

      public boolean groupByEligible()
      Returns the value of the groupByEligible record component.
      Returns:
      the value of the groupByEligible record component
    • timeSeriesEligible

      public boolean timeSeriesEligible()
      Returns the value of the timeSeriesEligible record component.
      Returns:
      the value of the timeSeriesEligible record component
    • distributionTermsEligible

      public boolean distributionTermsEligible()
      Returns the value of the distributionTermsEligible record component.
      Returns:
      the value of the distributionTermsEligible record component
    • distributionHistogramEligible

      public boolean distributionHistogramEligible()
      Returns the value of the distributionHistogramEligible record component.
      Returns:
      the value of the distributionHistogramEligible record component
    • metricFieldEligible

      public boolean metricFieldEligible()
      Returns the value of the metricFieldEligible record component.
      Returns:
      the value of the metricFieldEligible record component