Module org.jmolecules.ddd
Package org.jmolecules.ddd.types
Interface Association<T extends AggregateRoot<T,ID>,ID extends Identifier>
- All Superinterfaces:
Identifiable<ID>
@Stereotype(priority=0)
public interface Association<T extends AggregateRoot<T,ID>,ID extends Identifier>
extends Identifiable<ID>
An association to an
AggregateRoot.- Author:
- Christian Stettler, Henning Schwentner, Stephan Pirnbaum, Martin Schimak, John Sullivan, Oliver Drotbohm
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends AggregateRoot<T,ID>, ID extends Identifier>
Association<T,ID> forAggregate(T aggregate) static <T extends AggregateRoot<T,ID>, ID extends Identifier>
Association<T,ID> forId(ID identifier) Creates anAssociationpointing to the givenIdentifier.default booleandefault booleanReturns whether the currentAssociationpoints to the givenAggregateRoot.default booleanpointsToSameAggregateAs(Association<?, ID> other) Returns whether the currentAssociationpoints to the sameAggregateRootas the given one.Methods inherited from interface org.jmolecules.ddd.types.Identifiable
getId
-
Method Details
-
forAggregate
static <T extends AggregateRoot<T,ID>, Association<T,ID extends Identifier> ID> forAggregate(T aggregate) - Type Parameters:
T- the concreteAggregateRoottype.ID- the concreteIdentifiertype.- Parameters:
aggregate- must not be null.- Returns:
- an
Associationpointing to theIdentifierof the givenAggregateRoot, will never be null. - Since:
- 1.2
-
forId
static <T extends AggregateRoot<T,ID>, Association<T,ID extends Identifier> ID> forId(ID identifier) Creates anAssociationpointing to the givenIdentifier.- Type Parameters:
T- the concreteAggregateRoottype.ID- the concreteIdentifiertype.- Parameters:
identifier- must not be null.- Returns:
- an
Associationpointing to the givenIdentifier, will never be null. - Since:
- 1.2
-
pointsToSameAggregateAs
Returns whether the currentAssociationpoints to the sameAggregateRootas the given one. Unlike#equals(Object)and#hashCode()that also check for type equality of theAssociationitself, this only compares the targetIdentifierinstances.- Parameters:
other- must not be null.- Returns:
- whether the current
Associationpoints to the sameAggregateRootas the given one. - Since:
- 1.2
-
pointsTo
Returns whether the currentAssociationpoints to theAggregateRootwith the givenIdentifier. Unlike#equals(Object)and#hashCode()that also check for type equality of theAssociationitself, this only compares the targetIdentifierinstances.- Parameters:
identifier-- Returns:
- whether the current
Associationpoints to theAggregateRootwith the givenIdentifier. - Since:
- 1.4
-
pointsTo
Returns whether the currentAssociationpoints to the givenAggregateRoot. Unlike#equals(Object)and#hashCode()that also check for type equality of theAssociationitself, this only compares the targetIdentifierinstances.- Parameters:
aggregate- must not be null.- Returns:
- whether the current
Associationpoints to the givenAggregateRoot. - Since:
- 1.4
-