Skip to content

QRY_Builder.AggregateRow

Class

apex
global inherited sharing class QRY_Builder.AggregateRow

Typed wrapper around AggregateResult for convenient value access. Provides typed accessors that eliminate the need for manual casting from Object.

Example

apex
QRY_Builder.AggregateRow row = QRY_Builder.selectFrom(Account.SObjectType)
    .count('Id')
    .groupBy('Industry')
    .toAggregateList()[0];
Integer total = row.getInteger('expr0');
String industry = row.getString('Industry');

Methods

MethodDescription
global Object get(String alias)Gets a raw Object value by alias.
global Date getDate(String alias)Gets a Date value by alias.
global Decimal getDecimal(String alias)Gets a Decimal value by alias.
global Id getId(String alias)Gets an Id value by alias.
global Integer getInteger(String alias)Gets an Integer value by alias.
global Long getLong(String alias)Gets a Long value by alias.
global String getString(String alias)Gets a String value by alias.

get

apex
global Object get(String alias)

Gets a raw Object value by alias.

Parameters

ParameterTypeDescription
aliasStringThe aggregate alias or field name

Returns Object — The raw value

Example

apex
Object value = row.get('expr0');

getDate

apex
global Date getDate(String alias)

Gets a Date value by alias.

Parameters

ParameterTypeDescription
aliasStringThe aggregate alias or field name

Returns Date — The Date value

Example

apex
Date earliest = row.getDate('expr0');

getDecimal

apex
global Decimal getDecimal(String alias)

Gets a Decimal value by alias.

Parameters

ParameterTypeDescription
aliasStringThe aggregate alias or field name

Returns Decimal — The Decimal value

Example

apex
Decimal total = row.getDecimal('expr0');

getId

apex
global Id getId(String alias)

Gets an Id value by alias.

Parameters

ParameterTypeDescription
aliasStringThe aggregate alias or field name

Returns Id — The Id value

Example

apex
Id accountId = row.getId('AccountId');

getInteger

apex
global Integer getInteger(String alias)

Gets an Integer value by alias.

Parameters

ParameterTypeDescription
aliasStringThe aggregate alias or field name

Returns Integer — The Integer value

Example

apex
Integer count = row.getInteger('expr0');

getLong

apex
global Long getLong(String alias)

Gets a Long value by alias.

Parameters

ParameterTypeDescription
aliasStringThe aggregate alias or field name

Returns Long — The Long value

Example

apex
Long total = row.getLong('expr0');

getString

apex
global String getString(String alias)

Gets a String value by alias.

Parameters

ParameterTypeDescription
aliasStringThe aggregate alias or field name

Returns String — The String value

Example

apex
String industry = row.getString('Industry');