Reputation: 699
As you know, we can simply obtain a string from a hash using the toString() method. So we get string similar to this:
[first:[one:1.1], second:2]
The question is, how can we cast this string to hash again?
Upvotes: 3
Views: 3902
Reputation: 171084
You can use the Eval.me
static method:
def map = Eval.me( '[first:[one:1.1], second:2]' )
assert map == [first:[one:1.1], second:2]
Upvotes: 8