Serializer

interface Serializer<T, U>

Contract for converting domain entities to/from a data storage format.

Implementations must ensure that deserialize(serialize(input)) = input (round-trip integrity).

This contract was based on roby2014 - uni-projects/TDS

Parameters

T

The domain entity type to be serialized/deserialized.

U

The data format type for storage (e.g., String, ByteArray, etc.).

Functions

Link copied to clipboard
abstract fun deserialize(obj: U): T

Converts a stored representation back to a domain entity.

Link copied to clipboard
abstract fun serialize(obj: T): U

Converts a domain entity to its storage representation.