OpenNTF / org.openntf.domino

Open replacement for lotus.domino package in HCL Domino
Apache License 2.0
66 stars 34 forks source link

Add support for java.time classes #181

Closed jesse-gallagher closed 9 months ago

jesse-gallagher commented 1 year ago

Currently, ODA doesn't have support for setting or reading java.time types. There are two places that would need changes to support this.

Writing values with e.g. replaceItemValue will come to https://github.com/OpenNTF/org.openntf.domino/blob/develop/domino/core/src/main/java/org/openntf/domino/utils/TypeUtils.java#L2230 , which handles the final conversion from standard Java types to Domino-friendly ones. The code in the Date-handling block there, in particular the parts that handle the java.sql types, would be similar to what would be needed to handle LocalDate and LocalTime. I figure implementing those two plus OffsetDateTime and ZonedDateTime (both converted to Instant and then passed to Date.from(...)) would suffice.

Reading values will eventually come to https://github.com/OpenNTF/org.openntf.domino/blob/develop/domino/core/src/main/java/org/openntf/domino/utils/TypeUtils.java#L359 , I believe, which handles taking values out of Domino data and converting them to Java classes. There are branches there that look for requests for Date and DateTime (both individually and as arrays) and could be extended to handle those four java.time classes.