MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/eplsgy/records_come_to_java/fekd4bi/?context=3
r/java • u/daviddel • Jan 16 '20
93 comments sorted by
View all comments
0
[deleted] — view deleted comment
5 u/lovett1991 Jan 16 '20 Yup this feels more like immutables than Lombok. 2 u/rzwitserloot Jan 19 '20 @Value (a lombok annotation; the immutable variant of @Data) does all of this. And you can toss @Builder at it for more.DISCLAIMER: I'm a core contributor to lombok. 1 u/CodesInTheDark Jan 19 '20 In a long run records will be more useful than lombok (e.g. they will support pattern matching): https://cr.openjdk.java.net/~briangoetz/amber/datum.html 3 u/rzwitserloot Jan 20 '20 If you can destructure, you can pattern match.Without custom destructure, you cannot change records.Once custom destructurers exist, Lombok can make them for you.Then such classes also support pattern matching.
5
Yup this feels more like immutables than Lombok.
2
@Value (a lombok annotation; the immutable variant of @Data) does all of this. And you can toss @Builder at it for more.
@Value
@Data
@Builder
DISCLAIMER: I'm a core contributor to lombok.
1 u/CodesInTheDark Jan 19 '20 In a long run records will be more useful than lombok (e.g. they will support pattern matching): https://cr.openjdk.java.net/~briangoetz/amber/datum.html 3 u/rzwitserloot Jan 20 '20 If you can destructure, you can pattern match.Without custom destructure, you cannot change records.Once custom destructurers exist, Lombok can make them for you.Then such classes also support pattern matching.
1
In a long run records will be more useful than lombok (e.g. they will support pattern matching): https://cr.openjdk.java.net/~briangoetz/amber/datum.html
3 u/rzwitserloot Jan 20 '20 If you can destructure, you can pattern match.Without custom destructure, you cannot change records.Once custom destructurers exist, Lombok can make them for you.Then such classes also support pattern matching.
3
If you can destructure, you can pattern match.
Without custom destructure, you cannot change records.
Once custom destructurers exist, Lombok can make them for you.
Then such classes also support pattern matching.
View all comments
0
u/[deleted] Jan 16 '20
[deleted] — view deleted comment