"Numeric" comparison with other objects
CollinAlpert opened this issue · 5 comments
CollinAlpert commented
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 IllegalArgumentException
in the createNumericComparison
method, because java.time.LocalDate
is not a numeric value.
Any way I can get this to work?
kostat commented
Strictly speaking this wouldn't be Java. But I can consider extend it to
objects implementing Comparable interface
…On Mon, Jan 7, 2019, 21:43 Collin Alpert ***@***.*** wrote:
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?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#37>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFnpvFeHgKvlYso3l8ky8WSaMFg_swaoks5vA6NRgaJpZM4Z0MVK>
.
CollinAlpert commented
That would be great!
kostat commented
Ok, will do
…On Mon, Jan 7, 2019, 22:51 Collin Alpert ***@***.*** wrote:
That would be great!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFnpvDs7p2a2IDwdhvBuy6DmNj_esqLlks5vA7NagaJpZM4Z0MVK>
.
kostat commented
released in 2.4.3 version
CollinAlpert commented
Thanks so much!