Grails Cookbook - A collection of tutorials and examples

Groovy Set Examples

A Set is a collection of objects where all elements are unique and with no duplicates. The elements are not ordered and there are no repeating values. This is a very important data structure on certain programming scenarios. Below are some examples on how we declare and manipulate Sets in Groovy.

Groovy Compare String

We explore different examples of how String comparison behaves in Groovy. Below are some observations on Groovy compare String operations.

Groovy IDE Setup

One of the biggest technical hurdle when learning a new language is setting up your programming environment. This is a short guide on how to install a Groovy IDE to your Windows Workstation with screenshots for those who are new to the Java platform. We choose Eclipse as our Groovy IDE in the tutorial below.

Groovy Date Remove Or Clear Time Component

When we are comparing Date instances, we usually just care about the date part and not the time component. For more accurate comparison, it is sometimes desirable to remove the time component from a Date object. Below is an example on how to remove or clear time component from a Date instance in Groovy.

Groovy Assert Examples

Assertions are important for checking some conditions are met. This post will show examples on how to perform assertion in Groovy language.

Groovy Multiline String

We will show code snippet examples on how to declare Multiline String in Groovy.

Groovy Tokenize

We will show code snippet examples on how to tokenize a String in Groovy.

Groovy GString Examples

GString represents a String that may be used for template like functionality. It contains embedded values that can be evaluated lazily. For example, the GString "Hi ${name}" can be evaluated giving a value to name. Below are some examples.

Groovy Trim Examples

We will show code snippet examples on how to perform String trim in Groovy.

Grails 3 Project Structure Tutorial

If you are new to Grails development, this tutorial will discuss the structure of a Grails 3 application. There has been changes in the underlying technology behind Grails 3 and it would be a good start to understand the different sections, regardless if you have background to previous releases.