SimpleMapperRepo

class SimpleMapperRepo<FromKey, FromValue, ToKey, ToValue>(keyFromToTo: suspend FromKey.() -> ToKey, valueFromToTo: suspend FromValue.() -> ToValue, keyToToFrom: suspend ToKey.() -> FromKey, valueToToFrom: suspend ToValue.() -> FromValue) : MapperRepo<FromKey, FromValue, ToKey, ToValue> (source)

Simple implementation of MapperRepo that uses provided conversion functions.

Type Parameters

FromKey

The original key type

FromValue

The original value type

ToKey

The target key type

ToValue

The target value type

Constructors

Link copied to clipboard
constructor(keyFromToTo: suspend FromKey.() -> ToKey, valueFromToTo: suspend FromValue.() -> ToValue, keyToToFrom: suspend ToKey.() -> FromKey, valueToToFrom: suspend ToValue.() -> FromValue)

Properties

Link copied to clipboard

Provides a mapper for converting keys between inner and outer types.

Link copied to clipboard

Provides a mapper for converting values between inner and outer types.

Functions

Link copied to clipboard
open suspend override fun ToKey.toInnerKey(): FromKey

Converts a key from the outer type to the inner type.

Link copied to clipboard
open suspend override fun ToValue.toInnerValue(): FromValue

Converts a value from the outer type to the inner type.

Link copied to clipboard
open suspend override fun FromKey.toOutKey(): ToKey

Converts a key from the inner type to the outer type.

Link copied to clipboard
open suspend override fun FromValue.toOutValue(): ToValue

Converts a value from the inner type to the outer type.