You can use toMapString() method: http://mrhaki.blogspot.nl/2016/06/groovy-goodness-represent-map-as-string.html?m=1

Kind regards, Hubert Klein Ikkink

Op 17 dec. 2016 om 07:59 heeft bo zhang <zhangbodut@gmail.com> het volgende geschreven:

Hi everybody, I want to convert a Map to Groovy literal, is there convenient methods to do this or I have to write it myself?

For example,

assert convert(map)=="[a:'a',b:'b']"