ID - Type of the aggregate root identifier.public interface AggregateRoot<ID extends AggregateRootId> extends Entity<ID>
| Modifier and Type | Method and Description |
|---|---|
ID |
getId()
Returns the unique aggregate root identifier.
|
int |
getNextVersion()
Returns the next version of the aggregate.
|
@NotNull java.util.List<DomainEvent<?>> |
getUncommittedChanges()
Returns a list of uncommitted changes.
|
int |
getVersion()
Returns the current version of the aggregate.
|
boolean |
hasUncommitedChanges()
Returns the information if the aggregate has uncommited changes.
|
void |
loadFromHistory(DomainEvent<?>... history)
Loads the aggregate with historic events.
|
void |
loadFromHistory(@NotNull java.util.List<DomainEvent<?>> history)
Loads the aggregate with historic events.
|
void |
markChangesAsCommitted()
Clears the internal change list and sets the new version number.
|
ID getId()
getId in interface Entity<ID extends AggregateRootId>@NotNull @NotNull java.util.List<DomainEvent<?>> getUncommittedChanges()
boolean hasUncommitedChanges()
getUncommittedChanges(), else FALSE.void markChangesAsCommitted()
int getVersion()
int getNextVersion()
void loadFromHistory(@NotNull
DomainEvent<?>... history)
history - List of historic events.void loadFromHistory(@NotNull
@NotNull java.util.List<DomainEvent<?>> history)
history - List of historic events.Copyright © 2019 fuin.org (Germany). All Rights Reserved.