Language selector

records

In the dark ages, we had to wait for 3-4 years to see the new Java version with some new features. Now there are two major releases every year! Can we benefit from the new features before the next LTS release? We don’t have to wait 3 years or so for new features any more. Isn’t that cool? 😉 So… you’d like to check what has happened since Java 11? Record types?
Another (half a) year has passed, another major Java™ version has been released. Java was supposed “to be slow”. However, Java turns out to evolve so fast, that next releases aren’t just version bumps, but might significantly change the game rules. That’s a good reason for another deep dive in Java. We’re going to cover: Production ready GCs: ZGC and Shenandoah, if you don’t like ice ages Text blocks, which make Strings easy to declare also for non-liners Pattern matching with instanceof A.
In one of my previous posts I was torturing Java™ Records using Lombok. After receiving some really encouraging comments (‘what a sick idea you have, respect!'), delivering a deep-dive talk "Java 15. What’s new and noteworthy", and some discussions on JVM Poland Slack channel, I’ve decided to keep torturing. Sorry ;-)
When explaining Java records online I was asked several times ‘right, what about Lombok?’ In particular this question was ‘if the records are immutable, how are they different from Lombok’s @Value?’
When Java 14 was (about to be) released I saw a few discussions following more or less this schema: - Oh, records in Java, cool, finally we have automatically generated setters and getters! - No, records in Java are POJOs without any setters… - Oh, I see… Cool, finally in Java we have generated Beans, without any setters though!
In the previous post I wrote how to make a record and what is actually the purpose of the records. In this entry I focus on the limitations and abilities of the records.
Java 14 introduced records as a preview feature. There was (is?) a decent amount of confusion, declarations and even heavy insults against ‘enemy’ libraries and IDE plugins. Let me take part in thi s, please.
Java 14 brought Records as one of the preview features. For many it was reasonable to say “no more JavaBeans code generation” or “Lombok is dead”. Is that really the case? What one can do with records and what can’t? What about reflection and serialization? This talk has been presented at AllTheTalks.online.
Hey, there are two major Java versions released every year! We don’t have to wait 3 years or so for new features any more. Isn’t that cool? ;-) So… would you like to check out what has happened in Java 14? Switch expressions available to public? No more NPEs? Record types? Pattern matching? Text blocks? If you find them interesting, let’s dive deep together into new interesting stuff. This talk has been presented at Wrocław JUG and Warszawa JUG.

Language selector