Minor new features of Groovy 2.0
Although I’ve gone at length through the key major features of Groovy 2.0in the InfoQ article, there have been a few smaller ones which are interesting to note. And groovy guys like Tim Yates, André Steingress or Mr Hakki were quick to blog about them!
inject()
method with a default initial valuetakeWhile()
anddropWhile()
methodswithDefault()
,withEager()
methodsmatchesPartially()
method for matchers (to see if a string might match a pattern given more input)@NotYetImplemented
transformation for test cases- an iterable
collectEntries()
variant first()
andlast()
working with iterables as wellcollate()
method (although it’s also in 1.8.6 actually) (see coverage by Tim and Mr Hakki)- calendar ranges (useful for iterating over days of a certain period)
Those are some smaller features compared to the big highlights of Groovy 2.0, but they are definitely useful and make you more productive every day!