Interface AssociationResolver<T extends org.jmolecules.ddd.types.AggregateRoot<T,ID>,ID extends org.jmolecules.ddd.types.Identifier>

All Superinterfaces:
AggregateLookup<T,ID>

public interface AssociationResolver<T extends org.jmolecules.ddd.types.AggregateRoot<T,ID>,ID extends org.jmolecules.ddd.types.Identifier> extends AggregateLookup<T,ID>
Author:
Oliver Drotbohm
  • Method Summary

    Modifier and Type
    Method
    Description
    default Optional<T>
    resolve(org.jmolecules.ddd.types.Association<T,ID> association)
    Resolves the AggregateRoot pointed to by the given Association.
    default T
    resolveRequired(org.jmolecules.ddd.types.Association<T,ID> association)
    Resolves the AggregateRoot pointed to by the given Association.

    Methods inherited from interface org.jmolecules.spring.AggregateLookup

    findById
  • Method Details

    • resolve

      default Optional<T> resolve(org.jmolecules.ddd.types.Association<T,ID> association)
      Resolves the AggregateRoot pointed to by the given Association.
      Parameters:
      association - must not be null.
      Returns:
      will never be null.
    • resolveRequired

      default T resolveRequired(org.jmolecules.ddd.types.Association<T,ID> association)
      Resolves the AggregateRoot pointed to by the given Association.
      Parameters:
      association - must not be null.
      Returns:
      will never be null.
      Throws:
      IllegalArgumentException - in case the resolution fails.