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

org.meeuw.json.grep.matching.ObjectMatcherNot 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 1.8
 */
public class ObjectMatcherNot extends ObjectMatcher {

	private final ObjectMatcher wrapped;

	public ObjectMatcherNot(ObjectMatcher wrapped) {
		this.wrapped = wrapped;
	}

	@Override
	protected boolean matches(ParseEvent event) {
		return ! wrapped.matches(event);
	}

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

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

	@Override
	public String toString() {
		return "! " + wrapped.toString();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy