groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michał Mally <mic...@mally.pl>
Subject Re: How can I convert a Map to Groovy Literal?
Date Sat, 17 Dec 2016 09:51:00 GMT
Hello,

   You can use 'inspect' method:

     groovy> println ([a: 'b'].inspect())
     ['a':'b']

Warm regards,
Michal

W dniu 2016-12-17 07:59, bo zhang napisał(a):
> 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']"

Mime
View raw message