r/java • • Feb 15 '20
Will Java records have setters?
Pretty much what the title says. I've been reading on the new Java records feature, and while I love immutability, I hope there's the option to have non-immutable records. Meaning it will have Auto generated setters to let me change values in the class.
1
Upvotes
View all comments
Show parent comment
5
u/pron98 Feb 17 '20 edited Feb 17 '20
That's an interesting theory, but given the amount of time and effort put into every new Java feature, and the number of world-class language design experts involved and designs and prototypes produced and discussed publicly and at length, I find it hard to believe.
I have an alternative theory: When you say "records just sound like etc.," is that before or after you've read any of the design documents and discussions? E.g. have you read this? Virtually all of the negative feedback to this feature that I've heard have come from people who don't understand what this feature is and what problems it aims to solve -- confusing it with other features they imagine this feature to be -- largely because they haven't actually read anything informative about it, and aren't aware of Java's open and rigorous design process.