Reputation: 10296
While porting over a code fragment from python I've stumbled over a trivial problem:
if isinstance(v['content'], dict):
What would be the most elegant way to port this over to groovy?
Upvotes: 3
Views: 151
Reputation: 38189
You can use instanceof (see map-specific example here), like this:
instanceof
if (v['content'] instanceof java.util.map)
Upvotes: 5