With the introduction of lambdas in Java (not so) recently, some argue that Groovy lost some of its thunder, as closures are now first class citizens in the JDK. However, as I’m about to show, while lambda’s pushed the Java language a great deal forward, Groovy still makes a lot of things incredibly easy (and […]
Posts Tagged: GDK
Parallel : Groovy and Java Streams
This is something that every now and then I have to do: check whether either one or all elements of a collection meet a certain criteria. The standard code initially in Java involved a for loop and iterating through the collection explicitly and checking the condition at each step. Then Apache Commons came on with their […]
Goodies in Groovy from DefaultGroovyMethods
If you ever programmed in Groovy language, you probably “enjoyed” (maybe without realising) the joys of DefaultGroovyMethods. What you probably don’t realise is that you can override these methods to customize your classes — and occasionally generate some code that’s not that easy to read. (Do you remember the old C++ way of overriding operators […]
Odd Behaviour in Groovy when Comparing Maps
I came across this the other day and I ended up spending quite some time on it pulling my hair and I still couldn’t explain it in the end so I thought I’d post here to see if anyone can shed some light into it. In brief, it’s about Groovy’s (otherwise awesome!) feature of comparing […]