Groovy web console

subscribe to the feed Subscribe
to this
site

Closures.In.Map

Published 3 weeks ago by Daniel with tags map closure iteration
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def map = [
    'settings' : [ "bootStrap"	:  { println "Main Settings bootstrap" } ],
     "ac": [ 
        "settings": [ "bootStrap": { println "AC Settings bootstrap" } ],
        "categories": [ 
            "Arch": [ "settings": { println "Category bootstrap" } ]
        ]
    ]
]

map.each { mapkvp -> 
    if (mapkvp.key == "settings")
    {
        println "Working with Key: $mapkvp.key" 
        println "Working with Value: $mapkvp.value"
        mapkvp.value.each { it ->
            it.value()
        }
    }
}