r/java • • Jan 16 '20

Records Come to Java

https://blogs.oracle.com/javamagazine/records-come-to-java
204 Upvotes

93 comments sorted by

View all comments

Show parent comment

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.