K - the aggregate keyC - all commands for this aggregateE - all events generated for this aggregateA - the aggregate@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 if you will accept or reject the given command given the current aggregate aggregate and
transform 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 © 2018. All rights reserved.