records
5 tutorials tagged “records”.
- Record Patterns in JavaTake a record apart in one step with a record pattern: nested patterns, var, generics, record patterns in switch, exhaustiveness and the rules.
- Serializing Records in JavaRecords serialize differently: only their components are saved, and deserialization always goes through the canonical constructor, so validation runs again.
- Compact Constructors in RecordsValidate, normalize and defensively copy record data in a compact constructor, add extra constructors with this(...), and avoid the common errors.
- Records in JavaOne line declares an immutable data class: what a record generates, how to add methods, the rules, shallow immutability, and when to use one.
- Sealed Classes and Interfaces in JavaControl exactly which classes may extend a type with sealed and permits, the final, sealed and non-sealed rule, and exhaustive switches with no default.