MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/1ubn0gg/better_tools_for_immutable_data/otzegym/
r/java • u/daviddel • Jun 21 '26
38 comments sorted by
View all comments
Show parent comment
3
I assume you'll be able to create a custom constructor in the abstract record to validate the common fields, as well as supply additional methods that can reference those fields via this.
this
1 u/Scf37 Jun 26 '26 interface has default methods for that but in-constructor validation is a good point.
1
interface has default methods for that but in-constructor validation is a good point.
View all comments
Show parent comment
3
u/dododge Jun 26 '26
I assume you'll be able to create a custom constructor in the abstract record to validate the common fields, as well as supply additional methods that can reference those fields via
this.