public class DenyCommandNameFilter extends Object implements CommandMessageFilter
CommandMessageFilter implementation which denies CommandMessages based on their CommandMessage.getCommandName(). It can be combined with other CommandMessageFilter instances in an
efficient manner.| Constructor and Description |
|---|
DenyCommandNameFilter(Set<String> commandNames)
Initializes a
DenyCommandNameFilter from the given set of commandNames. |
DenyCommandNameFilter(String commandName)
Initializes a
DenyCommandNameFilter for a single commandName. |
| Modifier and Type | Method and Description |
|---|---|
CommandMessageFilter |
and(CommandMessageFilter other)
Returns a filter that matches when both this instance and the given
other match. |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
matches(CommandMessage<?> commandMessage)
Indicates whether the given
commandMessage matches this filter. |
CommandMessageFilter |
or(CommandMessageFilter other)
Returns a filter that matches when either this instance or the given
other matches. |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitnegate@ConstructorProperties(value="commandNames") public DenyCommandNameFilter(Set<String> commandNames)
DenyCommandNameFilter from the given set of commandNames. Commands with a name that
is present in this set will be blocked by this filter.commandNames - the names of commands blocked by this filterpublic DenyCommandNameFilter(String commandName)
DenyCommandNameFilter for a single commandName. Commands with a name equal to the
given commandName will be blocked by this filter.commandName - the name of the command blocked by this filterpublic boolean matches(@Nonnull CommandMessage<?> commandMessage)
CommandMessageFiltercommandMessage matches this filter.matches in interface CommandMessageFiltercommandMessage - the message to matchtrue if the command matches, otherwise falsepublic CommandMessageFilter and(@Nonnull CommandMessageFilter other)
CommandMessageFilterother match.and in interface CommandMessageFilterother - the other filter to match againstpublic CommandMessageFilter or(@Nonnull CommandMessageFilter other)
CommandMessageFilterother matches.or in interface CommandMessageFilterother - the other filter to match againstCopyright © 2010–2025. All rights reserved.