Interface Aggregation<T>

Type Parameters:
T - the type of the items to be aggregated
All Known Implementing Classes:
AbstractAggregation, AbstractNumberAggregation, BigDecimalAggregation, BigIntegerAggregation, CountAggregation, DateAggregation, DateTimeAggregation, DoubleAggregation, LocalDateAggregation, LocalDateTimeAggregation, LocalTimeAggregation, LongAggregation, OffsetDateTimeAggregation, OffsetTimeAggregation, TimeAggregation

public interface Aggregation<T>
Defines methods for performing aggregation operations on a collection of items.
  • Method Summary

    Modifier and Type
    Method
    Description
    avg(Collection<T> items)
    Computes the average value of the elements in the provided collection.
    int
    count(Collection<T> items)
    Counts the number of elements in the provided collection.
    Returns the class type of the result produced by this aggregation.
    Returns the set of aggregation types that are supported by this class.
    max(Collection<T> items)
    Determines the maximum value in the provided collection of items.
    min(Collection<T> items)
    Determines the minimum value in the provided collection of items.
    sum(Collection<T> items)
    Calculates the sum of the provided collection of items.
  • Method Details

    • sum

      @Nullable T sum(Collection<T> items)
      Calculates the sum of the provided collection of items.
      Parameters:
      items - the collection of items to be summed
      Returns:
      the sum of the items, or null if the collection is empty
    • avg

      @Nullable T avg(Collection<T> items)
      Computes the average value of the elements in the provided collection.
      Parameters:
      items - the collection of elements to be averaged
      Returns:
      the average value of the elements, or null if the collection is empty
    • min

      @Nullable T min(Collection<T> items)
      Determines the minimum value in the provided collection of items.
      Parameters:
      items - the collection of items to evaluate for the minimum value
      Returns:
      the minimum value from the collection, or null if the collection is empty
    • max

      @Nullable T max(Collection<T> items)
      Determines the maximum value in the provided collection of items.
      Parameters:
      items - the collection of items to evaluate for the maximum value
      Returns:
      the maximum value from the collection, or null if the collection is empty
    • count

      int count(Collection<T> items)
      Counts the number of elements in the provided collection.
      Parameters:
      items - the collection of items to be counted
      Returns:
      the total number of elements in the collection
    • getResultClass

      Class<T> getResultClass()
      Returns the class type of the result produced by this aggregation.
      Returns:
      the class representing the type of the result
    • getSupportedAggregationTypes

      EnumSet<AggregationInfo.Type> getSupportedAggregationTypes()
      Returns the set of aggregation types that are supported by this class.
      Returns:
      a set of supported aggregation types