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

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

package org.meeuw.json.grep.matching;

import java.util.function.Predicate;

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

/**
 * a keys matcher only considers the value of a json path for matching.
 */
abstract class ValueMatcher implements PathMatcher {
    @Override
    final public boolean matches(ParseEvent event, String value) {
        return matches(value);
    }

    protected abstract boolean matches(String value);

    @Override
    public Predicate needsKeyCollection() {
        return Predicates.alwaysFalse();
    }

    @Override
    public Predicate needsObjectCollection() {
        return Predicates.alwaysFalse();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy