mapper

inline fun <FromKey, FromValue, ToKey, ToValue> mapper(noinline keyFromToTo: suspend FromKey.() -> ToKey = { this as ToKey }, noinline valueFromToTo: suspend FromValue.() -> ToValue = { this as ToValue }, noinline keyToToFrom: suspend ToKey.() -> FromKey = { this as FromKey }, noinline valueToToFrom: suspend ToValue.() -> FromValue = { this as FromValue }): SimpleMapperRepo<FromKey, FromValue, ToKey, ToValue>(source)

Creates a MapperRepo with optional custom conversion functions. By default, uses casting for type conversions.

Parameters

keyFromToTo

Function to convert keys from inner to outer type

valueFromToTo

Function to convert values from inner to outer type

keyToToFrom

Function to convert keys from outer to inner type

valueToToFrom

Function to convert values from outer to inner type