Companion

object Companion

Base operations on Fields.

Functions

Link copied to clipboard
fun checkAligned(field1: Field<*, *>, field2: Field<*, *>, vararg fields: Field<*, *>)

Check if two or more fields are aligned, throwing an IllegalStateException otherwise.

Link copied to clipboard
inline fun <ID : Any, T, R> Field<ID, T>.fold(initial: R, crossinline transform: (R, T) -> R): R

Accumulates the elements of a field starting from an initial through a transform function. The local value of the field is not considered.

Link copied to clipboard
inline fun <ID : Any, T, R> Field<ID, T>.foldWithId(initial: R, crossinline transform: (R, ID, T) -> R): R

Accumulates the elements of a field starting from an initial through a transform function that includes the ID of the element. The local value of the field is not considered.

Link copied to clipboard
inline fun <ID : Any, T> Field<ID, T>.hood(default: T, crossinline transform: (T, T) -> T): T

Reduce the elements of the field using the transform function, returning the default value if the field to transform is empty. The local value is not considered.

Link copied to clipboard
inline fun <ID : Any, T> Field<ID, T>.hoodWithId(default: T, crossinline transform: (Pair<ID, T>, Pair<ID, T>) -> Pair<ID, T>): T

Reduce the elements of the field using the transform function, returning the default value if the field to transform is empty. The local value is not considered.

inline fun <ID : Any, T> Field<ID, T>.hoodWithId(default: T, crossinline transform: (T, ID, T) -> T): T

Reduce the elements of the field using the transform function, it includes the ID of the element whenever it should be considered in the transform function, but the ID is not returned. The local value of the field is not considered. Returns the default if the field to transform is empty.