replaceMatchingValues

inline fun <ID : Any, T> Field<ID, T>.replaceMatchingValues(replacement: T, crossinline predicate: Predicate<T>): Field<ID, T>

Returns a new field where each value matching the given predicate is replaced with replacement.

Entries that do not satisfy the predicate retain their original value. The local value is included in the check.

Return

a new field with values replaced where the predicate is satisfied.

Parameters

replacement

the value to assign to matching entries.

predicate

the condition used to determine which values to replace.