Groovy Cheat Sheet

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The reference material consulted while preparing these pages is listed in the section bibliography.

A single-page, colour-coded summary of the Apache Groovy language, written against Groovy 6.0 (6.0.0, released 2026-09-22; JDK 17 or newer) and checked on 2026-10-14, with additions after Groovy 4.0 labelled by release — running scripts and the tools, syntax and optional elements, the six string forms and GString laziness, numbers and the Groovy Truth, collection literals and the most used GDK methods, the operator grid with the operator-to-method table and the precedence ladder, control flow including switch expressions, closures with currying, composition and delegation, classes with the generating AST transformations, traits, records and sealed types, static typing, metaprogramming, file and process one-liners, JSON, XML, YAML, TOML, CSV, SQL and GINQ, the Groovy 6.0 concurrency features, DSLs and embedding, testing, and a strip of legacy idioms and their modern replacements — handy for quick memorization or as a downloadable PDF desk reference.

For the full explanation, every option, and additional examples, see the dedicated pages:

Start here — Groovy Reference.

Closures and functional programming — Closures, Closure Delegation: Owner, Delegate & This, and Functional Programming.

References

The PDF summarizes the official documentation; each source is cited in full on the page listed above that covers it, and in the section bibliography.