/** * Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot * not be NULL TRUE or FALSE literals. * * @param expr */ public static void checkEqualOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value == null) { throw new RuntimeException("'" + expr + "' cannot be compared."); } } }
/** * Only Numeric expressions can be used in {@code >}, {@code >=}, {@code <} or {@code <=} expressions. * * @param expr */ public static void checkLessThanOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value instanceof Number) { return; } // Else it's boolean or a String.. throw new RuntimeException("Value '" + expr + "' cannot be compared."); } if (expr instanceof BooleanExpression) { throw new RuntimeException("Value '" + expr + "' cannot be compared."); } }
/** * Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot * not be NULL TRUE or FALSE literals. * * @param expr */ public static void checkEqualOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value == null) { throw new RuntimeException("'" + expr + "' cannot be compared."); } } }
/** * Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot * not be NULL TRUE or FALSE literals. * * @param expr */ public static void checkEqualOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value == null) { throw new RuntimeException("'" + expr + "' cannot be compared."); } } }
/** * Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot * not be NULL TRUE or FALSE literals. * * @param expr */ public static void checkEqualOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value == null) { throw new RuntimeException("'" + expr + "' cannot be compared."); } } }
/** * Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot * not be NULL TRUE or FALSE literals. * * @param expr */ public static void checkEqualOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value == null) { throw new RuntimeException("'" + expr + "' cannot be compared."); } } }
/** * Validates that the expression can be used in {@code ==} or {@code <>} expression. Cannot * not be NULL TRUE or FALSE literals. * * @param expr */ public static void checkEqualOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value == null) { throw new RuntimeException("'" + expr + "' cannot be compared."); } } }
/** * Only Numeric expressions can be used in {@code >}, {@code >=}, {@code <} or {@code <=} expressions. * * @param expr */ public static void checkLessThanOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value instanceof Number) { return; } // Else it's boolean or a String.. throw new RuntimeException("Value '" + expr + "' cannot be compared."); } if (expr instanceof BooleanExpression) { throw new RuntimeException("Value '" + expr + "' cannot be compared."); } }
/** * Only Numeric expressions can be used in {@code >}, {@code >=}, {@code <} or {@code <=} expressions. * * @param expr */ public static void checkLessThanOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value instanceof Number) { return; } // Else it's boolean or a String.. throw new RuntimeException("Value '" + expr + "' cannot be compared."); } if (expr instanceof BooleanExpression) { throw new RuntimeException("Value '" + expr + "' cannot be compared."); } }
/** * Only Numeric expressions can be used in {@code >}, {@code >=}, {@code <} or {@code <=} expressions. * * @param expr */ public static void checkLessThanOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value instanceof Number) { return; } // Else it's boolean or a String.. throw new RuntimeException("Value '" + expr + "' cannot be compared."); } if (expr instanceof BooleanExpression) { throw new RuntimeException("Value '" + expr + "' cannot be compared."); } }
/** * Only Numeric expressions can be used in {@code >}, {@code >=}, {@code <} or {@code <=} expressions. * * @param expr */ public static void checkLessThanOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value instanceof Number) { return; } // Else it's boolean or a String.. throw new RuntimeException("Value '" + expr + "' cannot be compared."); } if (expr instanceof BooleanExpression) { throw new RuntimeException("Value '" + expr + "' cannot be compared."); } }
/** * Only Numeric expressions can be used in {@code >}, {@code >=}, {@code <} or {@code <=} expressions. * * @param expr */ public static void checkLessThanOperand(Expression expr) { if (expr instanceof ConstantExpression) { Object value = ((ConstantExpression) expr).getValue(); if (value instanceof Number) { return; } // Else it's boolean or a String.. throw new RuntimeException("Value '" + expr + "' cannot be compared."); } if (expr instanceof BooleanExpression) { throw new RuntimeException("Value '" + expr + "' cannot be compared."); } }