#1348 - ENH: Add support for bitwiseAnd / bitwiseAny / bitwiseAll .. expressions for use with integer/long "Flags" properties

This commit is contained in:
Rob Bygrave
2018-03-14 16:23:16 +13:00
parent 4bc1f2ede4
commit 602a35d0b6
29 changed files with 652 additions and 52 deletions
@@ -136,6 +136,21 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
return new ArrayIsEmptyExpression(propertyName, false);
}
@Override
public Expression bitwiseAny(String propertyName, long flags) {
return new BitwiseExpression(propertyName, BitwiseOp.ANY, flags, "!=", 0L);
}
@Override
public Expression bitwiseAll(String propertyName, long flags) {
return new BitwiseExpression(propertyName, BitwiseOp.ALL, flags, "=", flags);
}
@Override
public Expression bitwiseAnd(String propertyName, long flags, long match) {
return new BitwiseExpression(propertyName, BitwiseOp.AND, flags, "=", match);
}
/**
* Equal To - property equal to the given value.
*/