Package org.apache.groovy.ginq.provider.collection.runtime

# Interface GroupResult<K,T>

Type Parameters:
  `K` - the type of the group key
  `T` - the type of the grouped elements

All Superinterfaces:
  `Queryable<T>`

public interface GroupResult<K,T> extends Queryable<T>
Represents a group result from a `groupby...into` clause. Extends `Queryable` to provide aggregate and query methods on the group's elements, with a `key` property for accessing the group key.

Since:
  6.0.0

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.groovy.ginq.provider.collection.runtime.Queryable

  `Queryable.Order<T,U extends Comparable<? super U>>`

- ## Field Summary

  ### Fields inherited from interface org.apache.groovy.ginq.provider.collection.runtime.Queryable

  `EMPTY_QUERYABLE, NULL`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `get(String name)`
  Returns a named component of the group key.
  `default Object`
  `getAt(String name)`
  Subscript operator for accessing named key components.
  `K`
  `getKey()`
  Returns the group key.
  `static <K, T> GroupResult<K,T>`
  `of(K key, Queryable<T> group)`
  Factory method to create a `GroupResult` instance.

  ### Methods inherited from interface org.apache.groovy.ginq.provider.collection.runtime.Queryable

  `agg, avg, count, count, crossJoin, distinct, exists, fullHashJoin, fullJoin, groupBy, groupBy, groupByInto, groupByInto, innerHashJoin, innerJoin, intersect, leftHashJoin, leftJoin, limit, limit, list, max, median, min, minus, orderBy, orderBy, over, rightHashJoin, rightJoin, select, size, stdev, stdevp, stream, sum, toList, union, unionAll, var, varp, where`

- ## Method Details

  - ### getKey

    K getKey()
    Returns the group key. For single-key groupby, this is the raw key value. For multi-key groupby, this is a `NamedRecord` with named access.
    Returns:
      the group key

  - ### get

    Object get(String name)
    Returns a named component of the group key. Enables `g.name` property-style access and `g.get("name")` calls. For multi-key groupby, looks up the named component in the key record.
    Parameters:
      `name` - the key component name (from `as` alias in groupby)
    Returns:
      the value of the named key component
    Throws:
      `UnsupportedOperationException` - if this is a single-key group without aliases

  - ### getAt

    default Object getAt(String name)
    Subscript operator for accessing named key components. Enables `g["name"]` syntax.
    Parameters:
      `name` - the key component name
    Returns:
      the value of the named key component

  - ### of

    static <K, T> GroupResult<K,T> of(K key, Queryable<T> group)
    Factory method to create a `GroupResult` instance.
    Type Parameters:
      `K` - the type of the group key
      `T` - the type of the grouped elements
    Parameters:
      `key` - the group key
      `group` - the grouped elements as a Queryable
    Returns:
      a new GroupResult