Class CommandNameFilter
java.lang.Object
org.axonframework.commandhandling.distributed.commandfilter.CommandNameFilter
- All Implemented Interfaces:
Serializable,CommandMessageFilter
A
CommandMessageFilter implementation which filters CommandMessages by the CommandMessage.getCommandName(). It can be combined with other CommandMessageFilter instances in an
efficient manner.- Since:
- 3.0
- Author:
- Koen Lavooij
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommandNameFilter(String commandName) Initializes aCommandNameFilterfor a single command name.CommandNameFilter(Set<String> commandNames) Initializes aCommandNameFilterfor the given set ofcommandNames. -
Method Summary
Modifier and TypeMethodDescriptionand(CommandMessageFilter other) Returns a filter that matches when both this instance and the givenothermatch.booleaninthashCode()booleanmatches(CommandMessage<?> commandMessage) Indicates whether the givencommandMessagematches this filter.negate()Returns a filter that matches when this instance doesn't, and vice versa.or(CommandMessageFilter other) Returns a filter that matches when either this instance or the givenothermatches.toString()
-
Constructor Details
-
CommandNameFilter
Initializes aCommandNameFilterfor the given set ofcommandNames.- Parameters:
commandNames- commands that can be handled
-
CommandNameFilter
Initializes aCommandNameFilterfor a single command name.- Parameters:
commandName- command that can be handled
-
-
Method Details
-
matches
Description copied from interface:CommandMessageFilterIndicates whether the givencommandMessagematches this filter.- Specified by:
matchesin interfaceCommandMessageFilter- Parameters:
commandMessage- the message to match- Returns:
trueif the command matches, otherwisefalse
-
negate
Description copied from interface:CommandMessageFilterReturns a filter that matches when this instance doesn't, and vice versa.- Specified by:
negatein interfaceCommandMessageFilter- Returns:
- a filter that negates the result of this instance
-
and
Description copied from interface:CommandMessageFilterReturns a filter that matches when both this instance and the givenothermatch.- Specified by:
andin interfaceCommandMessageFilter- Parameters:
other- the other filter to match against- Returns:
- a filter that matches when both this instance and the other match
-
or
Description copied from interface:CommandMessageFilterReturns a filter that matches when either this instance or the givenothermatches.- Specified by:
orin interfaceCommandMessageFilter- Parameters:
other- the other filter to match against- Returns:
- a filter that matches when either this instance or the other matches
-
equals
-
hashCode
public int hashCode() -
toString
-