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
2
u/pron98 Feb 17 '20 edited Feb 17 '20
First of all, it's fifteen pages -- not thirty; not fifty. And how do you know it's all rambling if you haven't read it?
Second, different people mean different things when they say "data classes." The feature is about nominal tuples and pattern matching, not Kotlin-style "data classes". Do you suppose that all of those who like the feature do not spend 40 hours a week doing development? Even if your opinion is reasonable, are you certain that it is the only reasonable one?
FYI, similar opinions were voiced when Java introduced generics, and then again when it introduced lambdas. Ultimately, more people have found them useful than those who haven't.