tags:

views:

90

answers:

1

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?

+5  A: 

You can use instanceof (see map-specific example here), like this:

if (v['content'] instanceof java.util.map)
DNS