public interface Association<T extends AggregateRoot<T,ID>,ID extends Identifier> extends Identifiable<ID>
AggregateRoot.| Modifier and Type | Method and Description |
|---|---|
static <T extends AggregateRoot<T,ID>,ID extends Identifier> |
forAggregate(T aggregate)
|
static <T extends AggregateRoot<T,ID>,ID extends Identifier> |
forId(ID identifier)
Creates an
Association pointing to the given Identifier. |
default boolean |
pointsTo(ID identifier)
|
default boolean |
pointsTo(T aggregate)
Returns whether the current
Association points to the given AggregateRoot. |
default boolean |
pointsToSameAggregateAs(Association<?,ID> other)
Returns whether the current
Association points to the same AggregateRoot as the given one. |
getIdstatic <T extends AggregateRoot<T,ID>,ID extends Identifier> Association<T,ID> forAggregate(T aggregate)
T - the concrete AggregateRoot type.ID - the concrete Identifier type.aggregate - must not be null.Association pointing to the Identifier of the given AggregateRoot, will never be
null.static <T extends AggregateRoot<T,ID>,ID extends Identifier> Association<T,ID> forId(ID identifier)
Association pointing to the given Identifier.T - the concrete AggregateRoot type.ID - the concrete Identifier type.identifier - must not be null.Association pointing to the given Identifier, will never be null.default boolean pointsToSameAggregateAs(Association<?,ID> other)
Association points to the same AggregateRoot as the given one. Unlike
#equals(Object) and #hashCode() that also check for type equality of the Association
itself, this only compares the target Identifier instances.other - must not be null.Association points to the same AggregateRoot as the given one.default boolean pointsTo(ID identifier)
Association points to the AggregateRoot with the given
Identifier. Unlike #equals(Object) and #hashCode() that also check for type equality of the
Association itself, this only compares the target Identifier instances.identifier - Association points to the AggregateRoot with the given
Identifier.default boolean pointsTo(T aggregate)
Association points to the given AggregateRoot. Unlike
#equals(Object) and #hashCode() that also check for type equality of the Association
itself, this only compares the target Identifier instances.aggregate - must not be null.Association points to the given AggregateRoot.Copyright © 2023. All rights reserved.