def config = [aa:"true", bb:"false", cc:true, dd:false] println "[ begin ]" config.each { println it.key + " : " + it.value.getClass() } // convert string to boolean def stringKeys = [] config.findAll { it.value == "true" || it.value == "false"}.each{stringKeys << it?.key} stringKeys.each { config."$it" = config."$it".toBoolean() } println "[ end ]" config.each { println it.key + " : " + it.value.getClass() }