Class Group

java.lang.Object
io.fluxcapacitor.common.api.search.Group

public class Group extends Object
Represents a group key for aggregating documents in DocumentStats.

A Group consists of one or more path-value pairs used to categorize documents during aggregation. Each group corresponds to a unique combination of values across the specified groupBy paths.

Groups are typically created during the in-memory computation of statistics in a GetDocumentStatsResult, and identify which subset of documents a given DocumentStats applies to.

Example:
If grouping on "status" and "region", one Group might contain:
{"status": "active", "region": "EU"}

  • Constructor Details

  • Method Details

    • of

      public static Group of(String... pathsAndValues)
      Creates a Group from an even-length list of alternating keys and values.
      Parameters:
      pathsAndValues - An array of alternating path names and their corresponding values
      Returns:
      A new Group instance
      Throws:
      IllegalArgumentException - if the number of elements is odd
    • get

      public String get(String path)
      Returns the value associated with the given path in this group.
      Parameters:
      path - the path name
      Returns:
      the grouped value, or null if not present