Java Records for the Intrigued
summary
Java Records become a standard feature in Java 16 and act as transparent carriers for immutable data with compiler-generated private final fields, accessors, equals, hashCode and toString; compact constructors let validators run without reassigning fields; records cannot extend or be extended, add instance fields, or provide setters. Jackson 2.12+ serializes/deserializes records via constructors without extra annotations, but JPA/Hibernate generally fails (no no-arg constructor), while Morphia and Spring Boot 2.5+ can work. Records lack a built-in copy/withers mechanism.
AI-written summary · about
chapters (13)
- 0:00Introduction and speakers
- 1:02Talk overview and speaker intro
- 3:34What are Java Records?
- 7:05Record components and methods
- 10:39Record constructors and overrides
- 14:13Record limitations and restrictions
- 17:45Records vs JavaBeans and named tuples
- 20:16Nesting records and local records
- 24:30Reflection and annotations on records
- 26:37Serializing records with Jackson
- 31:16Records without copy methods
- 32:40Using records with frameworks
- 37:41Q&A session on records
related talks
42mBetter Modeling Through Records
34mWhen Records Meet Serialization A Happy Tale
37mRecords, Not Just Constant Classes, A Deep Dive
15mWorld Records - Overview and Use Cases for Records
54mData Oriented Programming with the JDK 19
15mWorld Record — Overview and Use Cases for Records
13mThe Record: Migrate to Immutability
50mBetter Tools for Immutable Data
