Functions
Link copied to clipboard
Check if two or more fields are aligned, throwing an IllegalStateException otherwise.
Link copied to clipboard
Link copied to clipboard
inline fun <ID : Any, T> Field<ID, T>.hoodWithId(default: T, crossinline reduce: (Pair<ID, T>, Pair<ID, T>) -> Pair<ID, T>): T
Reduce the elements of the field using the reduce 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.
inline fun <ID : Any, T, R> Field<ID, T>.hoodWithId(default: R, crossinline reduce: (Pair<ID, T>, Pair<ID, T>) -> Pair<ID, T>, crossinline select: Pair<ID, T>.() -> R): R
Reduce the entries of the field using the reduce function, and finally transforming them to a Result using select.