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.

Parameters

version

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

firstEventTime

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

state

The current state, with a generic type.

Constructors

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

Properties

Link copied to clipboard
open override val firstEventTime: Long
Link copied to clipboard

A computed property that indicates whether the entity has been initialized. Returns true if the version is greater than UNINITIALIZED_VERSION. This property is ignored during JSON serialization.

Link copied to clipboard

A computed property that indicates whether the entity is at its initial version. Returns true if the version equals INITIAL_VERSION. This property is ignored during JSON serialization.

Link copied to clipboard
open override val state: S
Link copied to clipboard
open override val version: Int

Functions

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

Creates a new snapshot with the specified state.