![JAR search and dependency download from the Maven repository](/logo.png)
org.joo.libra.logic.NotPredicate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of joo-libra Show documentation
Show all versions of joo-libra Show documentation
Java Predicate with SQL-like syntax support
package org.joo.libra.logic;
import org.joo.libra.Predicate;
import org.joo.libra.PredicateContext;
import org.joo.libra.common.CompositionPredicate;
import org.joo.libra.support.exceptions.PredicateExecutionException;
/**
* Represents a predicate with not
rule. It will be satisfied by if
* and only if the child predicate is not satisfied.
*
* @author griever
*
*/
public class NotPredicate implements CompositionPredicate {
private Predicate predicate;
public NotPredicate(final Predicate predicate) {
this.predicate = predicate;
}
@Override
public boolean satisfiedBy(final PredicateContext context) throws PredicateExecutionException {
return !predicate.satisfiedBy(context);
}
public String toString() {
return "NOT(" + predicate.toString() + ")";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy