final OQueryOperator leftOperator = ((OSQLFilterCondition) left).getOperator();
if ((rightOperator instanceof OQueryOperatorMajor || rightOperator instanceof OQueryOperatorMajorEquals)
&& (leftOperator instanceof OQueryOperatorMinor || leftOperator instanceof OQueryOperatorMinorEquals)) {
final OQueryOperatorBetween between = new OQueryOperatorBetween();
if (rightOperator instanceof OQueryOperatorMajor)
between.setLeftInclusive(false);
if (leftOperator instanceof OQueryOperatorMinor)
between.setRightInclusive(false);
return new OSQLFilterCondition(new OSQLFilterItemField(this, leftField), between, betweenBoundaries.toArray());
}
if ((leftOperator instanceof OQueryOperatorMajor || leftOperator instanceof OQueryOperatorMajorEquals)
&& (rightOperator instanceof OQueryOperatorMinor || rightOperator instanceof OQueryOperatorMinorEquals)) {
final OQueryOperatorBetween between = new OQueryOperatorBetween();
if (leftOperator instanceof OQueryOperatorMajor)
between.setLeftInclusive(false);
if (rightOperator instanceof OQueryOperatorMinor)
between.setRightInclusive(false);
Collections.reverse(betweenBoundaries);
return new OSQLFilterCondition(new OSQLFilterItemField(this, leftField), between, betweenBoundaries.toArray());