ID - Aggregate identifier.public abstract class AbstractAggregateRoot<ID extends AggregateRootId> extends java.lang.Object implements AggregateRoot<ID>
| Constructor and Description |
|---|
AbstractAggregateRoot()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
apply(@NotNull DomainEvent<?> event)
Applies the given new event.
|
boolean |
equals(java.lang.Object obj) |
protected java.util.List<java.lang.Class<? extends DomainEvent<?>>> |
getIgnoredEvents()
Returns a list of old / ignored events.
|
int |
getNextVersion()
Returns the next version of the aggregate.
|
java.util.List<DomainEvent<?>> |
getUncommittedChanges()
Returns a list of uncommitted changes.
|
int |
getVersion()
Returns the current version of the aggregate.
|
int |
hashCode() |
boolean |
hasUncommitedChanges()
Returns the information if the aggregate has uncommited changes.
|
void |
loadFromHistory(DomainEvent<?>... history)
Loads the aggregate with historic events.
|
void |
loadFromHistory(java.util.List<DomainEvent<?>> history)
Loads the aggregate with historic events.
|
void |
markChangesAsCommitted()
Clears the internal change list and sets the new version number.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetIdpublic final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final java.util.List<DomainEvent<?>> getUncommittedChanges()
AggregateRootgetUncommittedChanges in interface AggregateRoot<ID extends AggregateRootId>public final boolean hasUncommitedChanges()
AggregateRoothasUncommitedChanges in interface AggregateRoot<ID extends AggregateRootId>AggregateRoot.getUncommittedChanges(), else FALSE.public final void markChangesAsCommitted()
AggregateRootmarkChangesAsCommitted in interface AggregateRoot<ID extends AggregateRootId>public final int getVersion()
AggregateRootgetVersion in interface AggregateRoot<ID extends AggregateRootId>public final int getNextVersion()
AggregateRootgetNextVersion in interface AggregateRoot<ID extends AggregateRootId>public final void loadFromHistory(DomainEvent<?>... history)
AggregateRootloadFromHistory in interface AggregateRoot<ID extends AggregateRootId>history - List of historic events.public final void loadFromHistory(java.util.List<DomainEvent<?>> history)
AggregateRootloadFromHistory in interface AggregateRoot<ID extends AggregateRootId>history - List of historic events.protected final java.util.List<java.lang.Class<? extends DomainEvent<?>>> getIgnoredEvents()
protected final void apply(@NotNull
@NotNull DomainEvent<?> event)
event - Event to dispatch to the appropriate event handler method.Copyright © 2019 fuin.org (Germany). All Rights Reserved.