Groovy web console

subscribe to the feed Subscribe
to this
site
filter and remove from list (via #groovywebconsole)
tweet this snippet Tweet
this
script

filter and remove from list

Published 4 months ago by nmrao with tags filter list
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def list = [   
  [prerelease: 'true', author: [surname: 'surname', book: 'title'], surname: 'surname'],
  [prerelease: 'true', author: [surname: 'surname', book: 'title'], surname: 'surname'],
  [prerelease: 'false', author: [surname: 'surname', book: 'title'], surname: 'surname'] 
]

list.removeAll(list.findAll{it.prerelease == 'true'})
println list