r/java • • Jun 21 '26

Better Tools for Immutable Data

https://youtu.be/BdLND9D81lI?si=jt2tqpDtotmbdEJq
80 Upvotes

38 comments sorted by

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.

1

u/Scf37 Jun 26 '26

interface has default methods for that but in-constructor validation is a good point.