K - the aggregate key typeC - all commands for this aggregateE - all events generated for this aggregateA - the aggregate type@FunctionalInterface public interface CommandHandler<K,C,E,A>
| Modifier and Type | Method and Description |
|---|---|
Result<CommandError,NonEmptyList<E>> |
interpretCommand(K key,
A currentAggregate,
C command)
Determine whether you will accept the given command given the current aggregate and, if so, transform it into events.
|
Result<CommandError,NonEmptyList<E>> interpretCommand(K key, A currentAggregate, C command)
key - the aggregate key the command applies tocurrentAggregate - the aggregate for this aggregate guaranteed to be up to date with all events seen to datecommand - the command to validate and convert into eventsResult providing one or more Reasons for the
rejection. If accepting, return one or more events that represent the command.Copyright © 2019. All rights reserved.