Class PackageNameMatcher


  • public class PackageNameMatcher
    extends Object
    An utility class for filtering package names.
    • Method Detail

      • compile

        public static PackageNameMatcher compile​(List<String> specs)
        Compiles the given list of package name specification strings into a matching object.

        If the list is empty, the resulting object will never match any package name, which means that matches(String) will always return false.

        Parameters:
        specs - The list of package name specifications. For details on specification syntax see #compile(String).
        Returns:
        A new matching object.
        Throws:
        IllegalArgumentException - Thrown if the given argument is null or if any of the strings in the list is an invalid package name specification.
      • matches

        public boolean matches​(String packageName)
        Returns true if the given package name matches against any of the patterns in this matcher.
        Returns:
        Always false if the given package name is null or an empty string.