Skip to content

Commit 7c765f5

Browse files
committed
Register InstantConverter
1 parent 575933d commit 7c765f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/apache/commons/beanutils2/ConvertUtilsBean.java

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.nio.file.Path;
2727
import java.sql.Timestamp;
2828
import java.time.Duration;
29+
import java.time.Instant;
2930
import java.time.LocalDate;
3031
import java.time.LocalDateTime;
3132
import java.time.LocalTime;
@@ -57,6 +58,7 @@
5758
import org.apache.commons.beanutils2.converters.DurationConverter;
5859
import org.apache.commons.beanutils2.converters.FileConverter;
5960
import org.apache.commons.beanutils2.converters.FloatConverter;
61+
import org.apache.commons.beanutils2.converters.InstantConverter;
6062
import org.apache.commons.beanutils2.converters.IntegerConverter;
6163
import org.apache.commons.beanutils2.converters.LocalDateConverter;
6264
import org.apache.commons.beanutils2.converters.LocalDateTimeConverter;
@@ -488,6 +490,7 @@ private void registerStandard(final boolean throwException, final boolean defaul
488490
* <li>{@code java.util.Date.class} - {@link DateConverter}</li>
489491
* <li>{@code java.util.Calendar.class} - {@link CalendarConverter}</li>
490492
* <li>{@code File.class} - {@link FileConverter}</li>
493+
* <li>{@code Instant.class} - {@link InstantConverter}</li>
491494
* <li>{@code Path.class} - {@link PathConverter}</li>
492495
* <li>{@code java.sql.Date.class} - {@link SqlDateConverter}</li>
493496
* <li>{@code java.sql.Time.class} - {@link SqlTimeConverter}</li>
@@ -520,6 +523,7 @@ private void registerOther(final boolean throwException) {
520523
register(java.util.Date.class, throwException ? new DateConverter() : new DateConverter(null));
521524
register(Calendar.class, throwException ? new CalendarConverter() : new CalendarConverter(null));
522525
register(File.class, throwException ? new FileConverter() : new FileConverter(null));
526+
register(Instant.class, throwException ? new InstantConverter() : new InstantConverter(null));
523527
register(Path.class, throwException ? new PathConverter() : new PathConverter(null));
524528
register(java.sql.Date.class, throwException ? new SqlDateConverter() : new SqlDateConverter(null));
525529
register(java.sql.Time.class, throwException ? new SqlTimeConverter() : new SqlTimeConverter(null));
@@ -586,6 +590,7 @@ private void registerArrays(final boolean throwException, final int defaultArray
586590
registerArrayConverter(java.util.Date.class, new DateConverter(), throwException, defaultArraySize);
587591
registerArrayConverter(Calendar.class, new DateConverter(), throwException, defaultArraySize);
588592
registerArrayConverter(File.class, new FileConverter(), throwException, defaultArraySize);
593+
registerArrayConverter(Instant.class, new InstantConverter(), throwException, defaultArraySize);
589594
registerArrayConverter(Path.class, new PathConverter(), throwException, defaultArraySize);
590595
registerArrayConverter(java.sql.Date.class, new SqlDateConverter(), throwException, defaultArraySize);
591596
registerArrayConverter(java.sql.Time.class, new SqlTimeConverter(), throwException, defaultArraySize);

0 commit comments

Comments
 (0)