kumulant

GroupResult

@Serializable
@SerialName(value = "GroupResult")
data class GroupResult(val results: Map<String, Result>) : Result(source)

Aggregated snapshot of a StatGroup: a map from StatKey.name to the per-slot Result. Backs the result side of the schema layer; use the get(StatKey) operators below for type-safe lookup rather than going through results by string key.

Nested groups produce nested GroupResults; the get overloads taking a GroupStatKey chain through one level at a time.

@Serializable like every other Result, so a GroupResult produced by one process is the unit of merge consumed by another.

Constructors

Link copied to clipboard
constructor(results: Map<String, Result>)

Properties

Link copied to clipboard

Per-stat snapshots keyed by StatKey.name.

Functions

Link copied to clipboard
operator fun <K> get(group: GroupStatKey<K>): GroupResult

Typed lookup of the nested GroupResult itself; first step of dotted access.

operator fun <R : Result> get(key: StatKey<R>): R

Typed lookup by StatKey. The phantom R on the key narrows the return type so the caller doesn't cast. Throws if no result has been recorded for that key; the error message lists the available keys so a typo is obvious at the throw site.

operator fun <K, R : Result> get(group: GroupStatKey<K>, key: StatKey<R>): R
operator fun <R : Result> get(group: StatKey<GroupResult>, key: StatKey<R>): R

Typed lookup into a nested GroupResult: parent[groupKey, innerKey].

operator fun <K, R : Result> get(group: GroupStatKey<K>, select: K.() -> StatKey<R>): R

Typed lookup into a nested GroupResult via a key-selector lambda. Lets the caller write result[outer.auth] { successes } rather than result[outer.auth][outer.auth.keys.successes].

GroupResult

constructor(results: Map<String, Result>)(source)

get

operator fun <R : Result> get(key: StatKey<R>): R(source)

Typed lookup by StatKey. The phantom R on the key narrows the return type so the caller doesn't cast. Throws if no result has been recorded for that key; the error message lists the available keys so a typo is obvious at the throw site.


operator fun <R : Result> get(group: StatKey<GroupResult>, key: StatKey<R>): R(source)
operator fun <K, R : Result> get(group: GroupStatKey<K>, key: StatKey<R>): R(source)

Typed lookup into a nested GroupResult: parent[groupKey, innerKey].


operator fun <K> get(group: GroupStatKey<K>): GroupResult(source)

Typed lookup of the nested GroupResult itself; first step of dotted access.


operator fun <K, R : Result> get(group: GroupStatKey<K>, select: K.() -> StatKey<R>): R(source)

Typed lookup into a nested GroupResult via a key-selector lambda. Lets the caller write result[outer.auth] { successes } rather than result[outer.auth][outer.auth.keys.successes].

results

Per-stat snapshots keyed by StatKey.name.