revapi-java/src/main/java/org/revapi/java/FlatFilter.java
/**
     * A simple filter that scans only the direct children of some element.
     *
     * @param filter the function to determine if the filter {@link Filter#applies(Object)}
     * @param <T> the type of the element to accept
     * @return a filter implementation that does not descend into any element
     */
A simple filter that scans only the direct children of some element.
@param filter the function to determine if the filter  Filter#applies(Object)
@param  the type of the element to accept
@return a filter implementation that does not descend into any element
A simple filter that scans only the direct children of some element . @param filter the function to determine if the filter Filter#applies ( Object ) @param the type of the element to accept @return a filter implementation that does not descend into any element
public static <T> Filter<T> by(Function<T, Boolean> filter) {
        return new Filter<T>() {
            @Override public boolean applies(@Nullable T element) {
                return filter.apply(element);
            }
            @Override public boolean shouldDescendInto(@Nullable Object element) {
                return false;
            }
        };
    }
public static < T > Filter < T > by ( Function < T , Boolean > filter ) { return new Filter < T > ( ) { @ Override public boolean applies ( @ Nullable T element ) { return filter . apply ( element ) ; } @ Override public boolean shouldDescendInto ( @ Nullable Object element ) { return false ; } } ; }
A simple filter that scans only the direct children of some element.
A simple filter that scans only the direct children of some element .