@Override public void visit(NotExpression expression) { result = ImmutableList.of(termFactory.getFunctionNOT(termVisitor.getTerm(expression.getExpression()))); // throw new UnsupportedSelectQueryRuntimeException("Not a Boolean expression", expression); }
@Override public void visit(NotExpression expression) { result = ImmutableList.of(TERM_FACTORY.getFunctionNOT(termVisitor.getTerm(expression.getExpression()))); // throw new UnsupportedSelectQueryRuntimeException("Not a Boolean expression", expression); }
private Function negation(Function arg) { return (arg.getFunctionSymbol() == ExpressionOperation.NOT) ? (Function) arg.getTerm(0) : termFactory.getFunctionNOT(arg); }
private Function negation(Function arg) { return (arg.getFunctionSymbol() == ExpressionOperation.NOT) ? (Function) arg.getTerm(0) : TERM_FACTORY.getFunctionNOT(arg); }
@Override public void visit(RegExpMatchOperator expression) { Term flags; java.util.function.UnaryOperator<Function> not; switch (expression.getOperatorType()) { case MATCH_CASESENSITIVE: flags = termFactory.getConstantLiteral(""); not = UnaryOperator.identity(); break; case MATCH_CASEINSENSITIVE: flags = termFactory.getConstantLiteral("i"); not = UnaryOperator.identity(); break; case NOT_MATCH_CASESENSITIVE: flags = termFactory.getConstantLiteral(""); not = arg -> termFactory.getFunctionNOT(arg); break; case NOT_MATCH_CASEINSENSITIVE: flags = termFactory.getConstantLiteral("i"); not = arg -> termFactory.getFunctionNOT(arg); break; default: throw new UnsupportedOperationException(); } process(expression, (t1, t2) -> not.apply(termFactory.getFunction(ExpressionOperation.REGEX, t1, t2, flags))); }
@Override public void visit(RegExpMatchOperator expression) { Term flags; java.util.function.UnaryOperator<Function> not; switch (expression.getOperatorType()) { case MATCH_CASESENSITIVE: flags = TERM_FACTORY.getConstantLiteral(""); not = UnaryOperator.identity(); break; case MATCH_CASEINSENSITIVE: flags = TERM_FACTORY.getConstantLiteral("i"); not = UnaryOperator.identity(); break; case NOT_MATCH_CASESENSITIVE: flags = TERM_FACTORY.getConstantLiteral(""); not = arg -> TERM_FACTORY.getFunctionNOT(arg); break; case NOT_MATCH_CASEINSENSITIVE: flags = TERM_FACTORY.getConstantLiteral("i"); not = arg -> TERM_FACTORY.getFunctionNOT(arg); break; default: throw new UnsupportedOperationException(); } process(expression, (t1, t2) -> not.apply(TERM_FACTORY.getFunction(ExpressionOperation.REGEX, t1, t2, flags))); }
return termFactory.getFunctionNOT(term);