Class ImmutableRoot<T>
java.lang.Object
io.fluxzero.sdk.modeling.ImmutableEntity<T>
io.fluxzero.sdk.modeling.ImmutableRoot<T>
- All Implemented Interfaces:
Entity<T>, PersistedRoot<T>
- Direct Known Subclasses:
ImmutableAggregateRoot, ImmutableModelRoot
Shared immutable revision state of persisted Aggregate and Model roots.
Storage-specific roots add only metadata that is genuinely absent from the other contract: Aggregate relationship replay state or the Model namespace-wide state boundary. Jackson continues to expose these inherited properties as the same flat snapshot fields.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classImmutableRoot.ImmutableRootBuilder<T, C extends ImmutableRoot<T>, B extends ImmutableRoot.ImmutableRootBuilder<T,C, B>> Source-visible builder owner shared by Aggregate and Model roots.static interfacestatic interfacestatic interfaceNested classes/interfaces inherited from class ImmutableEntity
ImmutableEntity.ImmutableEntityBuilder<T,C, B> -
Field Summary
Fields inherited from interface Entity
AGGREGATE_ID_METADATA_KEY, AGGREGATE_SN_METADATA_KEY, AGGREGATE_TYPE_METADATA_KEY, ALREADY_EXISTS_EXCEPTION, applying, loading, NOT_FOUND_EXCEPTION -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedImmutableRoot(ImmutableRoot<T> source, String lastEventId, Long lastEventIndex, long sequenceNumber, Entity<T> previous) protectedImmutableRoot(Object id, Class<T> type, String idProperty, T value, EntityHelper entityHelper, Serializer serializer, String lastEventId, Long lastEventIndex, Instant timestamp, long sequenceNumber, Entity<T> previous) -
Method Summary
Modifier and TypeMethodDescriptionstatic <S,E> S replay(S initial, Iterator<E> events, ImmutableRoot.Transition<S, E> transition, ImmutableRoot.ReplayFailure<S, E> failure) Replays all events with one isolated loading context.static <S,E> S replayUntil(S initial, Iterator<E> events, ImmutableRoot.ReplayContinuation<S, E> include, ImmutableRoot.Transition<S, E> transition, ImmutableRoot.ReplayFailure<S, E> failure) Replays the ordered prefix accepted byincludewith one isolated loading context.static Entity<?> retainPrevious(Entity<?> previous, EntityMetadata.RootConfiguration configuration) Applies the shared bounded revision-retention policy used by persisted roots.abstract ImmutableRoot<T> withPrevious(Entity<T> previous) Returns this root revision with a different in-memory predecessor.Methods inherited from class ImmutableEntity
aliases, apply, apply, assertApplyCompatibility, assertApplyCompatibility, assertLegal, clearLoadingRouteCache, commit, computeAliases, computeEntities, descendantTargetMetadata, entities, get, restoreLoadingRouteCache, snapshotLoadingRouteCache, type, update, withTypeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Entity
aliases, allEntities, ancestors, ancestorValue, apply, apply, apply, apply, apply, apply, assertAndApply, assertAndApply, assertAndApply, assertAndApply, assertLegal, associations, commit, depth, dissociations, entities, filterEntity, filterPresent, findEntity, get, getEntity, getEntity, highestEventIndex, id, idProperty, ifPresent, isEmpty, isPresent, isRoot, map, mapEntity, mapIfPresent, orElse, orElseGet, orElseThrow, orElseThrow, playBackToCondition, playBackToEvent, possibleTargets, relationships, root, rootAnnotation, rootConfiguration, type, update, withTypeMethods inherited from interface PersistedRoot
lastEventId, lastEventIndex, parent, previous, sequenceNumber, timestamp, withEventIndex, withSequenceNumber
-
Constructor Details
-
ImmutableRoot
-
ImmutableRoot
-
-
Method Details
-
replay
public static <S,E> S replay(S initial, Iterator<E> events, ImmutableRoot.Transition<S, E> transition, ImmutableRoot.ReplayFailure<S, E> failure) Replays all events with one isolated loading context. -
replayUntil
public static <S,E> S replayUntil(S initial, Iterator<E> events, ImmutableRoot.ReplayContinuation<S, E> include, ImmutableRoot.Transition<S, E> transition, ImmutableRoot.ReplayFailure<S, E> failure) Replays the ordered prefix accepted byincludewith one isolated loading context. -
withPrevious
Returns this root revision with a different in-memory predecessor. -
retainPrevious
public static Entity<?> retainPrevious(Entity<?> previous, EntityMetadata.RootConfiguration configuration) Applies the shared bounded revision-retention policy used by persisted roots.
-