/** * Returns a filter that matches when both this instance and the given {@code other} match. * * @param other The other filter to match against * @return a filter that matches when both this instance and the other match */ default CommandMessageFilter and(CommandMessageFilter other) { return new AndCommandMessageFilter(this, other); }
@Override public CommandMessageFilter and(CommandMessageFilter other) { if (other instanceof DenyCommandNameFilter) { return new DenyCommandNameFilter( Stream.concat(commandNames.stream(), ((DenyCommandNameFilter) other).commandNames.stream()) .collect(Collectors.toSet())); } else { return new AndCommandMessageFilter(this, other); } }
/** * Returns a filter that matches when both this instance and the given {@code other} match. * * @param other The other filter to match against * @return a filter that matches when both this instance and the other match */ default CommandMessageFilter and(CommandMessageFilter other) { return new AndCommandMessageFilter(this, other); }
@Override public CommandMessageFilter and(CommandMessageFilter other) { if (other instanceof DenyCommandNameFilter) { return new DenyCommandNameFilter( Stream.concat(commandNames.stream(), ((DenyCommandNameFilter) other).commandNames.stream()) .collect(Collectors.toSet())); } else { return new AndCommandMessageFilter(this, other); } }