@Test public void testMatches() { final List<String> result1 = Input.filterClassNames( Arrays.asList( "com.example.Json", "com.example.AAAJson", "com.example.AAA", "com.example.aaa$Json" ), Arrays.asList("**Json") ); Assert.assertTrue(result1.contains("com.example.Json")); Assert.assertTrue(result1.contains("com.example.AAAJson")); Assert.assertTrue(!result1.contains("com.example.AAA")); Assert.assertTrue(result1.contains("com.example.aaa$Json")); final List<String> result2 = Input.filterClassNames( Arrays.asList( "com.example.Json", "cz.habarta.test.Json", "cz.habarta.test.BBBJson", "cz.habarta.test.aaa.BBBJson", "cz.habarta.test.CCC$Json" ), Arrays.asList("cz.habarta.test.*") ); Assert.assertTrue(!result2.contains("com.example.Json")); Assert.assertTrue(result2.contains("cz.habarta.test.Json")); Assert.assertTrue(result2.contains("cz.habarta.test.BBBJson")); Assert.assertTrue(!result2.contains("cz.habarta.test.aaa.BBBJson")); Assert.assertTrue(!result2.contains("cz.habarta.test.CCC$Json")); final List<String> result3 = Input.filterClassNames( Arrays.asList( "cz.habarta.test.BBBJson", "cz.habarta.ddd.CCC$Json", "cz.habarta.CCC$Json" ), Arrays.asList("cz.habarta.*.*$*") ); Assert.assertTrue(!result3.contains("cz.habarta.test.BBBJson")); Assert.assertTrue(result3.contains("cz.habarta.ddd.CCC$Json")); Assert.assertTrue(!result3.contains("cz.habarta.CCC$Json")); }
static List<String> filterClassNames(List<String> classNames, List<String> globs) { final List<Pattern> regexps = Utils.globsToRegexps(globs); final List<String> result = new ArrayList<>(); for (String className : classNames) { if (Utils.classNameMatches(className, regexps)) { result.add(className); } } return result; }
Input { static List<String> filterClassNames(List<String> classNames, List<String> globs) { final List<Pattern> regexps = Utils.globsToRegexps(globs); final List<String> result = new ArrayList<>(); for (String className : classNames) { if (Utils.classNameMatches(className, regexps)) { result.add(className); } } return result; } }
Input { static List<String> filterClassNames(List<String> classNames, List<String> globs) { final List<Pattern> regexps = Utils.globsToRegexps(globs); final List<String> result = new ArrayList<>(); for (String className : classNames) { if (Utils.classNameMatches(className, regexps)) { result.add(className); } } return result; } private  Input(List<SourceType<Type>> sourceTypes); }
Input { static List<String> filterClassNames(List<String> classNames, List<String> globs) { final List<Pattern> regexps = Utils.globsToRegexps(globs); final List<String> result = new ArrayList<>(); for (String className : classNames) { if (Utils.classNameMatches(className, regexps)) { result.add(className); } } return result; } private  Input(List<SourceType<Type>> sourceTypes); List<SourceType<Type>> getSourceTypes(); static Input from(Type... types); @Deprecated static Input fromClassNamesAndJaxrsApplication(List<String> classNames, List<String> classNamePatterns, String jaxrsApplicationClassName,
            boolean automaticJaxrsApplication, Predicate<String> isClassNameExcluded, URLClassLoader classLoader, boolean debug); @Deprecated static Input fromClassNamesAndJaxrsApplication(List<String> classNames,
            List<String> classNamePatterns, List<String> classesWithAnnotations,
            List<String> classesImplementingInterfaces, List<String> classesExtendingClasses,
            String jaxrsApplicationClassName,
            boolean automaticJaxrsApplication, Predicate<String> isClassNameExcluded,
            URLClassLoader classLoader, boolean debug); static Input from(Parameters parameters); }
Input { static List<String> filterClassNames(List<String> classNames, List<String> globs) { final List<Pattern> regexps = Utils.globsToRegexps(globs); final List<String> result = new ArrayList<>(); for (String className : classNames) { if (Utils.classNameMatches(className, regexps)) { result.add(className); } } return result; } private  Input(List<SourceType<Type>> sourceTypes); List<SourceType<Type>> getSourceTypes(); static Input from(Type... types); @Deprecated static Input fromClassNamesAndJaxrsApplication(List<String> classNames, List<String> classNamePatterns, String jaxrsApplicationClassName,
            boolean automaticJaxrsApplication, Predicate<String> isClassNameExcluded, URLClassLoader classLoader, boolean debug); @Deprecated static Input fromClassNamesAndJaxrsApplication(List<String> classNames,
            List<String> classNamePatterns, List<String> classesWithAnnotations,
            List<String> classesImplementingInterfaces, List<String> classesExtendingClasses,
            String jaxrsApplicationClassName,
            boolean automaticJaxrsApplication, Predicate<String> isClassNameExcluded,
            URLClassLoader classLoader, boolean debug); static Input from(Parameters parameters);  }