Skip to content

Instantly share code, notes, and snippets.

@mgdelacroix
Created February 13, 2014 16:24
Show Gist options
  • Save mgdelacroix/8978379 to your computer and use it in GitHub Desktop.
Save mgdelacroix/8978379 to your computer and use it in GitHub Desktop.
Pretty printer in groovy Lists and Maps
import groovy.json.JsonBuilder
java.util.LinkedHashMap.metaClass.pprint = { -> new JsonBuilder(delegate).toPrettyString() }
java.util.ArrayList.metaClass.pprint = { -> new JsonBuilder(delegate).toPrettyString() }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment