Using multidimentional Map in Groovy

--

Defining a map with multi dimentional Map in groovy.

def mapSS=[:]
mapSS[“docker1”]=[:]
mapSS[“docker1”][“Dockerfile”]=”dockerfile”
mapSS[“docker1”][“CPU”]=”1.5"
mapSS[“docker1”][“Memory”]=”1.5"
mapSS[“docker1”][“Port”]=”10000"
mapSS[“docker2”]=[:]
mapSS[“docker2”][“Dockerfile”]=”dockerfile”
mapSS[“docker2”][“CPU”]=”1.5"
mapSS[“docker2”][“Memory”]=”1.5"
mapSS[“docker2”][“Port”]=”10000"
println(mapSS[“docker1”][“Dockerfile”])
println(mapSS[“docker1”][“CPU”])
println(mapSS[“docker1”][“Memory”])
println(mapSS[“docker1”][“Port”])
println(mapSS.size())

Output will be:

dockerfile
1.5
1.5
10000
2

--

--