SmallMaterializedSnapshot

data class SmallMaterializedSnapshot<S : Any>(val version: Int, val firstEventTime: Long, val state: S) : Version, FirstEventTimeCapable, IMaterializedSnapshot<SmallMaterializedSnapshot<S>, S>

Represents a simplified materialized snapshot with generic state. This data class implements multiple interfaces to provide version, materialization, first event time, and state information.

Type Parameters

S

The type of the state data.

Constructors

Link copied to clipboard
constructor(version: Int, firstEventTime: Long, state: S)

Properties

Link copied to clipboard
open override val firstEventTime: Long

The timestamp of the first event, used to record when the state was first changed.

Link copied to clipboard

Whether the entity has been initialized.

Link copied to clipboard

Whether the entity is at its initial version.

Link copied to clipboard
open override val state: S

The current state, with a generic type.

Link copied to clipboard
open override val version: Int

The version of the snapshot, used to indicate the version of the state.

Functions

Link copied to clipboard
open override fun withState(state: S): SmallMaterializedSnapshot<S>

Creates a new snapshot with the specified state.