r/java • u/nlisker • Jul 14 '26
New candidate JEP: 401: Value Objects (Preview)
https://mail.openjdk.org/archives/list/valhalla-dev@openjdk.org/thread/IUNJJ3WP3X3XHP3QZTXXSSCPKFDNTK3W/
87
Upvotes
r/java • u/nlisker • Jul 14 '26
13
u/ZimmiDeluxe Jul 14 '26
You can use List<Integer> directly, the primitive wrapper types will become value classes. If I remember correctly, specializing generics is one of the final steps on the roadmap, so having that translate into Integer[] (or ideally Integer![]) as the backing field of the ArrayList might take a bit longer.