DirectCodec

class DirectCodec<VALUE : Any>(val serializer: Serializer<VALUE>) : Codec<VALUE, VALUE> (source)

Codec for a model used directly as both the domain and persisted representation.

Do not use this in production systems. Persisted data should have a representation independent of the domain model so domain changes cannot silently break stored data.

Constructors

Link copied to clipboard
constructor(serializer: Serializer<VALUE>)

Properties

Link copied to clipboard
open override val converter: Converter<VALUE, VALUE>
Link copied to clipboard
open override val serializer: Serializer<VALUE>

Functions

Link copied to clipboard
open fun decode(bytes: ByteArray): VALUE
Link copied to clipboard
open fun encode(value: VALUE): ByteArray