Groovy

Groovy programming language tutorials, examples, and best practices.

Groovy Date and Time – Modern API Guide with 12 Tested Examples

Groovy date and time with the java.time API. 12+ examples covering LocalDate, LocalDateTime, ZonedDateTime, Duration, formatting. Groovy 5.0.6. “The only reason for time is so that everything doesn’t happen at once.” Ray Cummings, The Girl in the Golden Atom (1922) Last Updated: July 2026 | Tested on: Groovy 5.0.6, Java 17+ | Difficulty: Beginner to Intermediate | Reading Time: 25 minutes If you’ve ever wrestled with java.util.Date and SimpleDateFormat in Groovy, you know the pain. Mutable date objects, thread-unsafe formatters, ... Read More

Groovy GINQ – SQL-Like Collection Queries with 12 Tested Examples

Groovy GINQ gives you SQL-like collection querying without leaving the language. 12+ examples covering select, where, joins, groupby, aggregates, and nested queries. Tested on Groovy 5.0.6. “Why leave Groovy to write SQL when you can bring SQL into Groovy? GINQ lets you query collections like database tables – right in your code.” Last Updated: July 2026 | Tested on: Groovy 5.0.6, Java 17+ | Difficulty: Intermediate | Reading Time: 25 minutes What is GINQ in Groovy? If you’ve ever worked ... Read More

Groovy REST API Consumption – Fetch and Parse JSON with 10+ Examples

Groovy REST API consumption with 10+ examples. Fetch JSON with URL.text, HttpURLConnection, POST requests, headers, and error handling on Groovy 5.0.6. “The best thing about Groovy’s HTTP support is that you can hit an API and parse the response in two lines of code. Try doing that in plain Java.” Last Updated: July 2026 | Tested on: Groovy 5.0.6, Java 17+ | Difficulty: Intermediate | Reading Time: 24 minutes Modern applications live and breathe APIs. Pulling data from a third-party ... Read More