TrigerSoft/jaque

"Numeric" comparison with other objects

CollinAlpert opened this issue · 5 comments

I am trying to implement comparisons like "greater than" or "less than" for non-numeric Java objects. For example a LocalDate. I want the LocalDate#isAfter(LocalDate) method to be evaluated as a "greater than" operation. What I tried (simplified version), was this:

LocalDate date1 = LocalDate.of(2016, 8, 23);
LocalDate date2 = LocalDate.now();
Expression.binary(ExpressionType.GreaterThan, Expression.constant(date1), Expression.constant(date2));

What I found was that JaQue throws an IllegalArgumentExceptionin the createNumericComparison method, because java.time.LocalDate is not a numeric value.
Any way I can get this to work?

That would be great!

released in 2.4.3 version

Thanks so much!