Class CommandFilter

java.lang.Object
com.sk89q.worldguard.util.command.CommandFilter
All Implemented Interfaces:
com.google.common.base.Predicate<String>, Predicate<String>

public class CommandFilter extends Object implements com.google.common.base.Predicate<String>
Checks whether a command is permitted with support for subcommands split by \s (regular expressions).

permitted always overrides denied (unlike other parts of WorldGuard). Either can be null. If both are null, then every command is permitted. If only permitted is null, then all commands but those in the list of denied are permitted. If only denied is null, then only commands in the list of permitted are permitted. If neither are null, only permitted commands are permitted and the list of denied commands is not used.

The test is case in-sensitive.

  • Constructor Details

    • CommandFilter

      public CommandFilter(@Nullable Collection<String> permitted, @Nullable Collection<String> denied)
      Create a new instance.
      Parameters:
      permitted - a list of rules for permitted commands
      denied - a list of rules for denied commands
  • Method Details

    • apply

      public boolean apply(String command)
      Specified by:
      apply in interface com.google.common.base.Predicate<String>