ROOT - Type of the aggregate root.ROOT_ID - Type of the aggregate identifier.ID - Type of the entity identifier.public abstract class AbstractEntity<ROOT_ID extends AggregateRootId,ROOT extends AbstractAggregateRoot<ROOT_ID>,ID extends EntityId> extends java.lang.Object implements Entity<ID>
| Constructor and Description |
|---|
AbstractEntity(ROOT root)
Constructor with root aggregate.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
apply(@NotNull DomainEvent<?> event)
Applies the given new event.
|
boolean |
equals(java.lang.Object obj) |
protected ROOT |
getRoot()
Returns the aggregate root the entity belongs to.
|
protected ROOT_ID |
getRootId()
Returns the identifier of the aggregate root the entity belongs to.
|
int |
hashCode() |
public AbstractEntity(@NotNull
ROOT root)
root - Root aggregate.protected final void apply(@NotNull
@NotNull DomainEvent<?> event)
event - Event to dispatch to the appropriate event handler method.public final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectprotected final ROOT getRoot()
protected final ROOT_ID getRootId()
Copyright © 2019 fuin.org (Germany). All Rights Reserved.