user734861 user734861 - 1 year ago 129
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!

Answer Source

Yes, you are right


Takes a closure as a parameter

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download