groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo zhang <zhangbo...@gmail.com>
Subject Re: How can I convert a Map to Groovy Literal?
Date Sat, 17 Dec 2016 09:58:55 GMT
Yes, that's exactly what I want, thank you very much!

2016-12-17 17:51 GMT+08:00 Michał Mally <michal@mally.pl>:

> 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