@Test public void equality() throws Exception { Expression expression = parseExpression("5 eq 5"); assertEquals("{5 EQ 5}", expression.toString()); expression = parseExpression("5 ne 5"); assertEquals("{5 NE 5}", expression.toString()); assertEquals("{1 EQ null}", parseExpression("1 eq null").toString()); assertEquals("{null NE 2}", parseExpression("null ne 2").toString()); assertEquals("{null EQ null}", parseExpression("null eq null").toString()); wrongExpression("5 eq '5'"); }
private Expression parseExpression() throws UriParserException, UriValidationException { Expression left = parseAnd(); while (tokenizer.next(TokenKind.OrOperator)) { checkType(left, EdmPrimitiveTypeKind.Boolean); checkNoCollection(left); final Expression right = parseAnd(); checkType(right, EdmPrimitiveTypeKind.Boolean); checkNoCollection(right); left = new BinaryImpl(left, BinaryOperatorKind.OR, right, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } return left; }
ExpressionParser { private Expression parseExpression() throws UriParserException, UriValidationException { Expression left = parseAnd(); while (tokenizer.next(TokenKind.OrOperator)) { checkType(left, EdmPrimitiveTypeKind.Boolean); checkNoCollection(left); final Expression right = parseAnd(); checkType(right, EdmPrimitiveTypeKind.Boolean); checkNoCollection(right); left = new BinaryImpl(left, BinaryOperatorKind.OR, right, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } return left; } }
ExpressionParser { private Expression parseExpression() throws UriParserException, UriValidationException { Expression left = parseAnd(); while (tokenizer.next(TokenKind.OrOperator)) { checkType(left, EdmPrimitiveTypeKind.Boolean); checkNoCollection(left); final Expression right = parseAnd(); checkType(right, EdmPrimitiveTypeKind.Boolean); checkNoCollection(right); left = new BinaryImpl(left, BinaryOperatorKind.OR, right, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } return left; } ExpressionParser(final Edm edm, final OData odata); }
ExpressionParser { private Expression parseExpression() throws UriParserException, UriValidationException { Expression left = parseAnd(); while (tokenizer.next(TokenKind.OrOperator)) { checkType(left, EdmPrimitiveTypeKind.Boolean); checkNoCollection(left); final Expression right = parseAnd(); checkType(right, EdmPrimitiveTypeKind.Boolean); checkNoCollection(right); left = new BinaryImpl(left, BinaryOperatorKind.OR, right, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } return left; } ExpressionParser(final Edm edm, final OData odata); Expression parse(UriTokenizer tokenizer, final EdmType referringType,
      final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases); }
ExpressionParser { private Expression parseExpression() throws UriParserException, UriValidationException { Expression left = parseAnd(); while (tokenizer.next(TokenKind.OrOperator)) { checkType(left, EdmPrimitiveTypeKind.Boolean); checkNoCollection(left); final Expression right = parseAnd(); checkType(right, EdmPrimitiveTypeKind.Boolean); checkNoCollection(right); left = new BinaryImpl(left, BinaryOperatorKind.OR, right, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } return left; } ExpressionParser(final Edm edm, final OData odata); Expression parse(UriTokenizer tokenizer, final EdmType referringType,
      final Collection<String> crossjoinEntitySetNames, final Map<String, AliasQueryOption> aliases);  }