Skip to content

Instantly share code, notes, and snippets.

@sixman9
Created July 25, 2012 10:54
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sixman9/3175528 to your computer and use it in GitHub Desktop.
Save sixman9/3175528 to your computer and use it in GitHub Desktop.
Turn/convert a map into a list in Groovy
def m = [a:b, c:d]
def l = []
m.each() { k, v -> l << k }
Alternatively:
def m = new TreeMap([a:b, c:d])
then use m.keySet().each() ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment