Guide45.7K views3,238 votes0 replies2,770 following
Using Groovy’s @Canonical to Auto‑Generate Equality, HashCode, toString and Copy Methods
Use Groovy’s @Canonical annotation to automatically generate equals, hashCode, toString and a copy method for a simple value object, then verify with compilation and unit tests while watching for mutable‑field pitfalls.