All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.meeuw.json.grep.matching.Not Maven / Gradle / Ivy

package org.meeuw.json.grep.matching;

import java.util.function.Predicate;

import org.meeuw.json.ParseEvent;
import org.meeuw.json.Path;

/**
 * @author Michiel Meeuwissen
 * @since 0.6
 */
public class Not implements PathMatcher {

    private final PathMatcher wrapped;

    public Not(PathMatcher wrapped) {
        this.wrapped = wrapped;
    }

    @Override
    public boolean matches(ParseEvent event, String value) {
        return ! wrapped.matches(event, value);
    }

    @Override
    public Predicate needsKeyCollection() {
        return wrapped.needsKeyCollection();

    }

    @Override
    public Predicate needsObjectCollection() {
        return wrapped.needsObjectCollection();

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy