English | 简体中文

api-docs / org.ktorm.entity / aggregateTo

aggregateTo

inline fun <E : Any, K : Any, R, M : MutableMap<in K?, R>> EntityGrouping<E, *, K>.aggregateTo(
    destination: M,
    operation: (key: K?, accumulator: R?, element: E, first: Boolean) -> R
): M
(source code)

Groups elements from the source sequence by key and applies operation to the elements of each group sequentially,
passing the previously accumulated value and the current element as arguments, and stores the results in the given
destination map.

This function is delegated to Grouping.aggregateTo, more details can be found in its documentation.