toTargetIdsOrNull

fun <T, R> PatchField<Collection<T>?>.toTargetIdsOrNull(transform: (T) -> R): Set<R>?(source)

Converts this field to the set of target ids a junction relation must be synced to, or null if the relation must not be touched (PatchField.Unset).

Value(null) and Value(emptyList()) both result in an empty set. transform maps each element to its raw id, which is required for single-property wrapper types since those are not unwrapped automatically. The receiver is declared with a nullable collection, so both PatchField<List<X>> and PatchField<List<X>?> resolve to this function.


Same as toTargetIdsOrNull for elements that already are raw ids.