@Test @DisplayName("List all private primitive fields") void testStream() { Set<Field> fields = Arrays.stream(TestSelector.class.getDeclaredFields()) .filter(Selector.compile("private & primitive")::match) .collect(Collectors.toSet()); Assertions.assertEquals(3, fields.size()); }
public static Selector compile(String expression) { final var it = new Selector(expression); it.top = SelectorCompiler.compile(expression); return it; }
Selector { public static Selector compile(String expression) { final var it = new Selector(expression); it.top = SelectorCompiler.compile(expression); return it; } }
Selector { public static Selector compile(String expression) { final var it = new Selector(expression); it.top = SelectorCompiler.compile(expression); return it; } private  Selector(String expression); }
Selector { public static Selector compile(String expression) { final var it = new Selector(expression); it.top = SelectorCompiler.compile(expression); return it; } private  Selector(String expression); static Selector compile(String expression); Selector converterRe(String name, Function<T, Object> function); Selector converter(String name, Function<T, Object> function); @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"}) Selector selector(String name, Function<T, Boolean> function); Selector selectorRe(String name, Function<T, Boolean> function); @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"}) Selector regexSelector(String name, BiFunction<T, Pattern, Boolean> function); @SuppressWarnings("WeakerAccess") boolean match(Object member); }
Selector { public static Selector compile(String expression) { final var it = new Selector(expression); it.top = SelectorCompiler.compile(expression); return it; } private  Selector(String expression); static Selector compile(String expression); Selector converterRe(String name, Function<T, Object> function); Selector converter(String name, Function<T, Object> function); @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"}) Selector selector(String name, Function<T, Boolean> function); Selector selectorRe(String name, Function<T, Boolean> function); @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"}) Selector regexSelector(String name, BiFunction<T, Pattern, Boolean> function); @SuppressWarnings("WeakerAccess") boolean match(Object member);  }