@Nullable @Override public Condition visit(NotCondition condition, Void context) { return condition.getCondition(); }
@Nullable @Override public Void visit(NotCondition condition, @Nullable String context) { return condition.getCondition().visit(this, context); }
@Nullable @Override public Boolean visit(NotCondition condition, @Nullable Void context) { // Check the referenced condition return condition.getCondition().visit(this, null); }
public Void visit(NotCondition condition, Void context) { return condition.getCondition().visit(this, null); }
@Nullable @Override public Void visit(NotCondition condition, @Nullable Void context) { return condition.getCondition().visit(this, null); }
public static Condition not(Condition condition) { if (condition instanceof NotCondition) { return ((NotCondition) condition).getCondition(); } return new NotConditionImpl(condition); }
@Nullable @Override public Boolean visit(NotCondition condition, @Nullable String context) { return !condition.getCondition().visit(this, context); }
@Override public boolean equals(Object o) { return (this == o) || (o instanceof NotCondition) && _condition.equals(((NotCondition) o).getCondition()); }
@Override public Boolean visit(NotCondition condition, @Nullable Object json) { return !condition.getCondition().visit(this, json); }
public Void visit(NotCondition condition, Void context) { return condition.getCondition().visit(this, null); }
@Override public final Boolean visit(NotCondition right, Void context) { // If possible invert the right condition Condition inverseRight = InverseEvaluator.getInverseOf(right.getCondition()); if (inverseRight != null) { return checkIsSubset(_left, inverseRight); } // If possible invert the left condition. Since "not(x) subset not(y)" == "y subset x", if the left condition // can be inverted such that "not(invertedLeft)" == "left" then we can return "right.condition subset inverseLeft" Condition inverseLeft = InverseEvaluator.getInverseOf(_left); if (inverseLeft != null) { return checkIsSubset(right.getCondition(), inverseLeft); } // Neither left nor right have an inverse. If the right's condition is distinct from left then it is // a subset. For example: "ugc_us:ugc" is a subset of "not(like("*:sys"))" because "ugc_us:ugc" // and "like("*:sys")" are distinct. return DistinctEvaluator.areDistinct(_left, right.getCondition()); }
@Override public Boolean visit(NotCondition left, Condition right) { // If the left has an inverse then use that Condition inverseLeft = InverseEvaluator.getInverseOf(left.getCondition()); if (inverseLeft != null) { return checkIsSubset(inverseLeft, right); } // Default visitor behavior will evaluate this correctly, returning false in all cases except alwaysTrue() // and the double-negative condition, not(right) subset? not(left) LeftResolvedVisitor<NotCondition> visitor = new LeftResolvedVisitor<>(left); return right.visit(visitor, null); }