SimpleStateAggregate
class SimpleStateAggregate<S : Any>(val aggregateId: AggregateId, val metadata: StateAggregateMetadata<S>, val state: S, var ownerId: String = OwnerId.DEFAULT_OWNER_ID, var version: Int = Version.UNINITIALIZED_VERSION, var eventId: String = "", var firstOperator: String = "", var operator: String = "", var firstEventTime: Long = 0, var eventTime: Long = 0, var deleted: Boolean = false) : StateAggregate<S> , TypedAggregate<S>
A simple implementation of StateAggregate that manages aggregate state through event sourcing.
This class applies domain events to update the aggregate's state, handles ownership transfers, deletion, and recovery events, and maintains versioning for consistency.
Parameters
S
The type of the aggregate state.
Constructors
Link copied to clipboard
constructor(aggregateId: AggregateId, metadata: StateAggregateMetadata<S>, state: S, ownerId: String = OwnerId.DEFAULT_OWNER_ID, version: Int = Version.UNINITIALIZED_VERSION, eventId: String = "", firstOperator: String = "", operator: String = "", firstEventTime: Long = 0, eventTime: Long = 0, deleted: Boolean = false)
Properties
Link copied to clipboard
The unique identifier of the aggregate.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The timestamp of the first event. Defaults to 0.
Link copied to clipboard
The operator who initiated the first event. Defaults to an empty string.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Metadata describing the state aggregate, including sourcing functions.
Link copied to clipboard
The identifier of the current owner of the aggregate. Defaults to OwnerId.DEFAULT_OWNER_ID.
Link copied to clipboard
The current version of the aggregate. Defaults to Version.UNINITIALIZED_VERSION.