Skip to content

Records in depth: validation, defensive copies and withers #93

Open

Description

@mperor

Goal: go beyond the basic PairRecord test and show how records are used in practice.

Show:

  • compact canonical constructor for validation and normalization
  • defensive copy of a mutable component (List.copyOf)
  • "wither" methods returning a modified copy
  • pitfall: array components and generated equals

Where: FirstSteps/src/test/java/pl/mperor/lab/java/idiom

Activity

  1. added
    track:idiomsIdiomatic modern Java combining several features
    dailyQueued for the daily learning PR
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dailyQueued for the daily learning PRtrack:idiomsIdiomatic modern Java combining several features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions