Interface AggregateIdResolver<T,​ID>

  • Type Parameters:
    T - The type of object that this resolver support. Could e.g. be a COMMAND, EVENT, Aggregate STATE, VIEW, etc.
    ID - The type of Aggregate Id

    public interface AggregateIdResolver<T,​ID>
    Interface responsible for resolve the optional aggregate id associated with the type T
    Example of usages:
    • Command - return the aggregate id associated with the command (can return an Optional.empty()) in case server generated id's are used for commands that create a new Aggregate instance)
    • Event - return the aggregate id associated with the event
    • State - return the aggregate id associated with the aggregate state event projection
    • View - return the aggregate id associated with the View event projection
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Optional<ID> resolveFrom​(T t)
      Resolve the optional aggregate id associated with the type T
      Example of usages:
      Command - return the aggregate id associated with the command (can return an Optional.empty()) in case server generated id's are used for commands that create a new Aggregate instance) Event - return the aggregate id associated with the event State - return the aggregate id associated with the aggregate state event projection View - return the aggregate id associated with the View event projection
    • Method Detail

      • resolveFrom

        Optional<ID> resolveFrom​(T t)
        Resolve the optional aggregate id associated with the type T
        Example of usages:
        • Command - return the aggregate id associated with the command (can return an Optional.empty()) in case server generated id's are used for commands that create a new Aggregate instance)
        • Event - return the aggregate id associated with the event
        • State - return the aggregate id associated with the aggregate state event projection
        • View - return the aggregate id associated with the View event projection
        Parameters:
        t - the instance of T
        Returns:
        if the t contains an aggregate id then it MUST be returned in an Optional.of(Object) otherwise an Optional.empty()