March 2024
Intermediate to advanced
798 pages
18h 48m
English
This chapter includes 19 problems that cover, in detail, the Java records introduced in JDK 16 (JEP 395), and record patterns introduced as a preview feature in JDK 19 (JEP 405), as a second preview feature in JDK 20 (JEP 432), and as a final feature in JDK 21 (JEP 440).
We start by defining a simple Java record. We continue by analyzing a record’s internals, what it can and cannot contain, how to use records in streams, how they improve serialization, and so on. We are also interested in how we can use records in Spring Boot applications, including JPA and jOOQ technologies.
Next, we focus on record patterns for instanceof and switch. We will talk about nested record patterns, guarded record patterns, handling ...