identity

inline fun <T : Any> identity(name: String): Codec<T, T>(source)

Builds a codec that forwards values without transforming them.

Return

a codec that simply echoes the provided value for both encoding and decoding.

Parameters

T

value type handled by the codec.

name

human readable identifier used in error messages.

See also