public class DenyCommandNameFilter extends Object implements CommandMessageFilter
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, wait
negate
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(CommandMessage commandMessage)
CommandMessageFilter
commandMessage
matches this filter.matches
in interface CommandMessageFilter
commandMessage
- The message to matchtrue
if the command matches, otherwise false
public CommandMessageFilter and(CommandMessageFilter other)
CommandMessageFilter
other
match.and
in interface CommandMessageFilter
other
- The other filter to match againstpublic CommandMessageFilter or(CommandMessageFilter other)
CommandMessageFilter
other
matches.or
in interface CommandMessageFilter
other
- the other filter to match againstCopyright © 2010–2020. All rights reserved.