Subversion
Written by: Lorna Jane Mitchell
Featured Refcardz: Top Refcardz:
  1. Git
  2. DNS
  3. Data Mining
  4. Spring Data
  5. Subversion
  1. Spring Data
  2. Subversion
  3. Spring Config.
  4. Spring Annotations
  5. Data Mining

Link Details

Link 865497 thumbnail
User 185351 avatar

By jsugrue
via java.dzone.com
Published: Oct 18 2012 / 08:24

Since Groovy 1.8.7 we can create a list and use the withDefault() method to define a default value for elements that are not yet in the list. We use a closure as argument of the method, which returns the default value. We can even access the index of the element in the closure as an argument.
  • 5
  • 0
  • 493
  • 358

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (5)



Voters Against This Link (0)