Interface EventTargetMatcher<E>
- Type Parameters:
E- The type of entity this matcher is applied to.
- All Known Implementing Classes:
RoutingKeyEventTargetMatcher
- 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 that determines if a given entity should be targeted for a specific
EventMessage.
Typically used to test whether an entity qualifies to process an event and evolve its state accordingly.
Before version 5.0.0, this interface was known as org.axonframework.modelling.command.ForwardingMode.
The interface is now a predicate, instead of a function that returns a part of a list. This allows for
more flexible and efficient matching of entities against events in a processing context.
- Since:
- 3.1
- Author:
- Steven van Beelen, Mitchell Herrijgers
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> EventTargetMatcher<E> Returns a matcher that matches any entity, meaning it will always returntruefor any entity andEventMessage.booleanmatches(E targetEntity, EventMessage message, ProcessingContext processingContext)
-
Method Details
-
matches
boolean matches(@Nonnull E targetEntity, @Nonnull EventMessage message, @Nonnull ProcessingContext processingContext) - Parameters:
targetEntity- The entity of typeEto test.message- TheEventMessageto test.processingContext- TheProcessingContextin which the message is being processed.- Returns:
trueif the entity should be invoked for the message,falseotherwise.
-
MATCH_ANY
Returns a matcher that matches any entity, meaning it will always returntruefor any entity andEventMessage.- Type Parameters:
E- The type of the entity to match.- Returns:
- An
EventTargetMatcherthat matches any entity.
-