Class AggregatableDelegate<K>

java.lang.Object
io.jmix.flowui.data.aggregation.impl.AggregatableDelegate<K>
Type Parameters:
K - the type of the key used to identify items for aggregation

@Component("flowui_AggregatableDelegate") @Scope("prototype") public class AggregatableDelegate<K> extends Object
A delegate component responsible for performing data aggregation operations.
  • Field Details

  • Constructor Details

    • AggregatableDelegate

      public AggregatableDelegate()
  • Method Details

    • setAggregations

      @Autowired public void setAggregations(Aggregations aggregations)
    • setCurrentAuthentication

      @Autowired public void setCurrentAuthentication(CurrentAuthentication currentAuthentication)
    • setDatatypeRegistry

      @Autowired public void setDatatypeRegistry(DatatypeRegistry datatypeRegistry)
    • setItemProvider

      public void setItemProvider(Function<K,Object> itemProvider)
      Sets the item provider function that determines how items are provided based on their identifier.
      Parameters:
      itemProvider - a function to set
    • setItemValueProvider

      public void setItemValueProvider(BiFunction<K,MetaPropertyPath,Object> itemValueProvider)
      Sets the item value provider function that determines how values are resolved for items.
      Parameters:
      itemValueProvider - a function to set
    • aggregate

      public Map<AggregationInfo,String> aggregate(AggregationInfo[] aggregationInfos, Collection<K> itemsIds)
      Aggregates data based on an array of AggregationInfo objects and a collection of item identifiers.
      Parameters:
      aggregationInfos - an array of AggregationInfo objects that define the type and properties for aggregation
      itemsIds - a collection of item identifiers representing the items subjected to aggregation
      Returns:
      a map representing the formatted result of the aggregation for the given info
      Throws:
      NullPointerException - if aggregationInfos or itemsIds is null.
      IllegalStateException - if the aggregationInfos array is empty.
    • aggregateValues

      public Map<AggregationInfo,Object> aggregateValues(AggregationInfo[] aggregationInfos, Collection<K> itemIds)
      Aggregates values based on the provided AggregationInfo array and collection of item identifiers.
      Parameters:
      aggregationInfos - an array of AggregationInfo objects
      itemIds - a collection of item identifiers representing the items to aggregate values from
      Returns:
      a map representing the result of the aggregation for the given info
    • doAggregation

      protected Map<AggregationInfo,String> doAggregation(AggregationInfo[] aggregationInfos, Collection<K> itemIds)
    • doPropertyAggregation

      @Nullable protected Object doPropertyAggregation(AggregationInfo aggregationInfo, Collection<K> itemIds)
    • valuesByProperty

      protected List<?> valuesByProperty(MetaPropertyPath propertyPath, Collection<K> itemIds)