diff --git a/pom.xml b/pom.xml index f63bf667..5d5a4c9d 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.7 + 1.6.13 true ossrh diff --git a/rsql-common/src/main/java/io/github/perplexhub/rsql/RSQLVisitorBase.java b/rsql-common/src/main/java/io/github/perplexhub/rsql/RSQLVisitorBase.java index d7c5d000..2f78f765 100644 --- a/rsql-common/src/main/java/io/github/perplexhub/rsql/RSQLVisitorBase.java +++ b/rsql-common/src/main/java/io/github/perplexhub/rsql/RSQLVisitorBase.java @@ -1,10 +1,7 @@ package io.github.perplexhub.rsql; import java.lang.reflect.*; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.OffsetDateTime; -import java.time.ZonedDateTime; +import java.time.*; import java.time.format.DateTimeParseException; import java.util.*; import java.util.Map.Entry; @@ -80,6 +77,8 @@ protected Object convert(String source, Class targetType) { object = Boolean.valueOf(source); } else if (targetType.isEnum()) { object = Enum.valueOf(targetType, source); + } else if (targetType.equals(Instant.class)) { + object = Instant.parse(source); } else { Constructor cons = (Constructor) targetType.getConstructor(new Class[] { String.class }); object = cons.newInstance(new Object[] { source });