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

## [Java] Interface GroupResult<K, T>

- org.apache.groovy.ginq.provider.collection.runtime.Queryable

- All Superinterfaces:
    Queryable

      public interface GroupResult<K, T>
      extends Queryable

  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.

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

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Object` | `get(String name)` Returns a named component of the group key.
    `` | `public Object` | `getAt(String name)` Subscript operator for accessing named key components.
    `` | `public K` | `getKey()` Returns the group key.
    `<K, T>` | `public static GroupResult<K, T>` | `of(K key, Queryable<T> group)` Factory method to create a GroupResult instance.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface Queryable` | `agg, avg, count, count, crossJoin, distinct, emptyQueryable, exists, from, from, from, from, 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 Detail

    - #### public 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.

      throws:
        UnsupportedOperationException if this is a single-key group without aliases
      Parameters:
        `name` - the key component name (from `as` alias in groupby)
      Returns:
        the value of the named key component

    - #### public 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

    - #### public 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

    - #### <K, T> public static GroupResult<K, T> of(K key, Queryable<T> group)

      Factory method to create a GroupResult instance.

      Parameters:
        `key` - the group key
        `group` - the grouped elements as a Queryable
      Type Parameters:
        `K` - the type of the group key
        `T` - the type of the grouped elements
      Returns:
        a new GroupResult