public static DVConstraint createNumericConstraint(int validationType, int comparisonOperator,String expr1, String expr2) {switch (validationType) {case ValidationType.ANY:if (expr1 != null || expr2 != null) {throw new IllegalArgumentException("expr1 and expr2 must be null for validation type 'any'");}break;case ValidationType.DECIMAL:case ValidationType.INTEGER:case ValidationType.TEXT_LENGTH:if (expr1 == null) {throw new IllegalArgumentException("expr1 must be supplied");}OperatorType.validateSecondArg(comparisonOperator, expr2);break;default:throw new IllegalArgumentException("Validation Type ("+ validationType + ") not supported with this method");}String formula1 = getFormulaFromTextExpression(expr1);Double value1 = formula1 == null ? convertNumber(expr1) : null;String formula2 = getFormulaFromTextExpression(expr2);Double value2 = formula2 == null ? convertNumber(expr2) : null;return new DVConstraint(validationType, comparisonOperator, formula1, formula2, value1, value2, null);}

public static DVConstraint CreateNumericConstraint(int validationType, int comparisonOperator,String expr1, String expr2){switch (validationType){case ValidationType.ANY:if (expr1 != null || expr2 != null){throw new ArgumentException("expr1 and expr2 must be null for validation type 'any'");}break;case ValidationType.DECIMAL:case ValidationType.INTEGER:case ValidationType.TEXT_LENGTH:if (expr1 == null){throw new ArgumentException("expr1 must be supplied");}OperatorType.ValidateSecondArg(comparisonOperator, expr2);break;default:throw new ArgumentException("Validation Type ("+ validationType + ") not supported with this method");}String formula1 = GetFormulaFromTextExpression(expr1);Double value1 = formula1 == null ? ConvertNumber(expr1) : double.NaN;String formula2 = GetFormulaFromTextExpression(expr2);Double value2 = formula2 == null ? ConvertNumber(expr2) : double.NaN;return new DVConstraint(validationType, comparisonOperator, formula1, formula2, value1, value2, null);}
