QRY_Builder.AggregateRow
Class
global inherited sharing class QRY_Builder.AggregateRowTyped wrapper around AggregateResult for convenient value access. Provides typed accessors that eliminate the need for manual casting from Object.
Since: 1.0
Example:
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
| Method | Description |
|---|---|
| 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. |
Method Details
get
global Object get(String alias)Gets a raw Object value by alias.
Parameters:
alias(String) - The aggregate alias or field name
Returns: Object - The raw value
Since: 1.0
Example:
Object value = row.get('expr0');getDate
global Date getDate(String alias)Gets a Date value by alias.
Parameters:
alias(String) - The aggregate alias or field name
Returns: Date - The Date value
Since: 1.0
Example:
Date earliest = row.getDate('expr0');getDecimal
global Decimal getDecimal(String alias)Gets a Decimal value by alias.
Parameters:
alias(String) - The aggregate alias or field name
Returns: Decimal - The Decimal value
Since: 1.0
Example:
Decimal total = row.getDecimal('expr0');getId
global Id getId(String alias)Gets an Id value by alias.
Parameters:
alias(String) - The aggregate alias or field name
Returns: Id - The Id value
Since: 1.0
Example:
Id accountId = row.getId('AccountId');getInteger
global Integer getInteger(String alias)Gets an Integer value by alias.
Parameters:
alias(String) - The aggregate alias or field name
Returns: Integer - The Integer value
Since: 1.0
Example:
Integer count = row.getInteger('expr0');getLong
global Long getLong(String alias)Gets a Long value by alias.
Parameters:
alias(String) - The aggregate alias or field name
Returns: Long - The Long value
Since: 1.0
Example:
Long total = row.getLong('expr0');getString
global String getString(String alias)Gets a String value by alias.
Parameters:
alias(String) - The aggregate alias or field name
Returns: String - The String value
Since: 1.0
Example:
String industry = row.getString('Industry');