Interface AggregateIdResolver<T,ID>
-
- Type Parameters:
T- The type of object that this resolver support. Could e.g. be aCOMMAND,EVENT, AggregateSTATE,VIEW, etc.ID- The type of Aggregate Id
public interface AggregateIdResolver<T,ID>Interface responsible for resolve the optional aggregate id associated with the typeT
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 typeT
Example of usages:
Command - return the aggregate id associated with the command (can return anOptional.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 typeT
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
tcontains an aggregate id then it MUST be returned in anOptional.of(Object)otherwise anOptional.empty()
- Command - return the aggregate id associated with the command (can return an
-
-