user734861 user734861 - 6 months ago 56
Groovy Question

Understanding groovy symantics?

I am trying to understand semantics of a particular groovy syntax.

def c = Account.createCriteria()

def results = c.list {
like("holderFirstName", "Fred%")
and {
between("balance", 500, 1000)
eq("branch", "London")
order("holderLastName", "desc")

Is the {content} after c.list a closure. So, that can we understand that c.list method takes in a closure as parameter? Thanks!


Yes, you are right


Takes a closure as a parameter