Support for JDK 14 record types
See original GitHub issue(note: created based on https://github.com/FasterXML/jackson-future-ideas/issues/46)
With JDK 14 Java will get Record type of classes. While it appears that they can already be used with right set of configuration options, it would probably make sense to add explicit support to maybe use different auto-detect defaults.
Support should be done in a way that does not require JDK 14 dependency by jackson-databind
(that is a leap too far even for 3.0 at least as of May 2020): either so that
- If possible, detection simply uses existing JDK functionality (assuming enough features are translated into bytecode accessible using JDK 8 methods), OR
- If support does require JDK 14 API, create another module (
jackson-module-jdk14
orjackson-datatype-jdk14
, depending).
Marking tentatively as 3.0, but may be moved to a 2.x version if and when someone actual works on this.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:14
- Comments:15 (8 by maintainers)
Top Results From Across the Web
4 Records - Java - Oracle Help Center
JDK 14 introduces records, which are a new kind of type declaration. Like an enum, a record is a restricted form of a...
Read more >Java 14 Record Keyword - Baeldung
Records are immutable data classes that require only the type and name of fields. The equals, hashCode, and toString methods, as well as...
Read more >Java record type - Data classes in Java - HowToDoInJava
Learn about record type in java. It is introduced as preview feature in Java 14 and shall be used as plain immutable data...
Read more >Java 14 Records Class | DigitalOcean
A Record class is final, so we can't extend it. · The Record classes implicitly extend java. · All the fields specified in...
Read more >Java 14 Feature Spotlight: Records - InfoQ
Java SE 14 (March 2020) introduces records as a preview feature. · A record can be best thought of as a nominal tuple;...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released as part of Jackson 2.12.0.
And there! It is done – initial implementation at any rate.
If anyone wants to check it out that would be highly appreciated. The highest value contribution would probably be addition of tests in
RecordTest
undersrc/test-jdk14/java
(same test class or new ones whatever) – I suspect that there may be edge cases wrt handling of annotations, mostly on deserialization side.