I have a map with keys in dot notation, but I need it as a nested map.
[test.key.one: \'value1\', text.key.two: \'value2\']
Now the result
There is one handy class: groovy.util.ConfigSlurper
def map = ['test.key.one': 'value1', 'test.key.two': 'value2']
def props = new Properties()
props.putAll(map)
println new ConfigSlurper().parse(props) // [test:[key:[two:value2, one:value1]]]
The only drawback is that it expects java.util.Properties
instance, so you need to create one from the map
.