Interface EntityCommandHandler<E>
- Type Parameters:
E- The type of the entity.
- All Superinterfaces:
MessageHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface describing a handler of a
CommandMessage for that uses an entity to make a decision.
This is typically used in the context of an EntityMetamodel where the entity instance is passed to the
handler to allow for more complex command handling logic.- Since:
- 5.0.0
- Author:
- Mitchell Herrijgers
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionhandle(CommandMessage command, E entity, ProcessingContext context) Handles the givenCommandMessagefor the givenentity.
-
Method Details
-
handle
@Nonnull MessageStream.Single<CommandResultMessage> handle(@Nonnull CommandMessage command, @Nonnull E entity, @Nonnull ProcessingContext context) Handles the givenCommandMessagefor the givenentity.- Parameters:
command- TheCommandMessageto handle.entity- The entity instance to handle the command for.context- TheProcessingContextfor the command.- Returns:
- The result of the command handling, which may be a
CommandResultMessageor an error message.
-