EntityAdapter

interface EntityAdapter<T>

Interface for adapters that handle the mapping between domain entities and Keystone storage structures.

Usually generated by the Keystone KSP compiler for classes annotated with @Entity.

Properties

Link copied to clipboard
abstract val type: String

The unique type identifier for this entity class.

Functions

Link copied to clipboard
abstract fun fromSnapshot(snapshot: Keystone.Snapshot): T

Reconstructs an entity instance from a Keystone storage snapshot.

Link copied to clipboard
abstract fun getId(entity: T): String

Extracts the unique identifier from an entity instance.

Link copied to clipboard
abstract fun toMap(entity: T): Map<String, Any>

Maps the entity properties to a flat key-value map for storage.