map<R> method

Codec<R> map<R>(
  1. R from(
    1. T
    ),
  2. T to(
    1. R
    )
)

Adds domain conversions while preserving this codec's storage family.

Implementation

Codec<R> map<R>(R Function(T) from, T Function(R) to) => Codec(
  sqlType,
  (value) => from(decode(value)),
  (value) => encode(to(value)),
);