com.aerospike.jdbc.predicate.Operator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aerospike-jdbc Show documentation
Show all versions of aerospike-jdbc Show documentation
A JDBC driver for the Aerospike database
The newest version!
package com.aerospike.jdbc.predicate;
import com.aerospike.client.exp.Exp;
import org.apache.calcite.sql.SqlKind;
import org.apache.calcite.sql.SqlOperator;
import static com.aerospike.jdbc.predicate.OperatorBinary.*;
import static com.aerospike.jdbc.predicate.OperatorUnary.NOT;
import static com.aerospike.jdbc.predicate.OperatorVarArgs.IN;
public interface Operator {
Exp exp(Exp... expressions);
static Operator parsed(SqlOperator op) {
if (op.kind == SqlKind.EQUALS) return EQ;
if (op.kind == SqlKind.LESS_THAN) return LT;
if (op.kind == SqlKind.LESS_THAN_OR_EQUAL) return LE;
if (op.kind == SqlKind.GREATER_THAN) return GT;
if (op.kind == SqlKind.GREATER_THAN_OR_EQUAL) return GE;
if (op.kind == SqlKind.NOT_EQUALS) return NE;
if (op.kind == SqlKind.OR) return OR;
if (op.kind == SqlKind.AND) return AND;
if (op.kind == SqlKind.NOT) return NOT;
if (op.kind == SqlKind.IN) return IN;
throw new UnsupportedOperationException("Unsupported operator type");
}
static boolean isBoolean(Operator operator) {
return operator == OR || operator == AND;
}
static boolean isVarArgs(Operator operator) {
return operator == IN;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy