Imagine you have a list of items: List<String> books = Arrays.asList( "The Holy Cow: The Bovine Testament", "True Hip Hop", "Truth and Existence", "The Big Book of Green Design" ); (Don't judge me. Books from this random book generator) Now you'd like to create a new list where the third item only is replaced by … Continue reading How to Use Java 8 Streams to Swiftly Replace Elements in a List
Tag: jOOλ
How to Translate SQL GROUP BY and Aggregations to Java 8
I couldn't resist. I have read this question by Hugo Prudente on Stack Overflow. And I knew there had to be a better way than what the JDK has to offer. The question reads: I'm looking for a lambda to refine the data already retrieved. I have a raw resultset, if the user do not … Continue reading How to Translate SQL GROUP BY and Aggregations to Java 8
Let’s Stream a Map in Java 8 with jOOλ
I wanted to find an easy way to stream a Map in Java 8. Guess what? There isn't! What I would've expected for convenience is the following method: public interface Map<K, V> { default Stream<Entry<K, V>> stream() { return entrySet().stream(); } } But there's no such method. There are probably a variety of reasons why … Continue reading Let’s Stream a Map in Java 8 with jOOλ
Don’t Miss out on Writing Java 8 SQL One-Liners with jOOλ or jOOQ
More and more people are catching up with the latest update to our platform by adopting functional programming also for their businesses. At Data Geekery, we're using Java 8 for our jOOQ integration tests, as using the new Streams API with lambda expressions makes generating ad-hoc test data so much easier. However, we don't feel … Continue reading Don’t Miss out on Writing Java 8 SQL One-Liners with jOOλ or jOOQ
When the Java 8 Streams API is not Enough
Java 8 was - as always - a release of compromises and backwards-compatibility. A release where the JSR-335 expert group might not have agreed upon scope or feasibility of certain features with some of the audience. See some concrete explanations by Brian Goetz about why ... ... "final" is not allowed in Java 8 default … Continue reading When the Java 8 Streams API is not Enough
Three-State Booleans in Java
Every now and then, I miss SQL's three-valued BOOLEAN semantics in Java. In SQL, we have: TRUE FALSE UNKNOWN (also known as NULL) Every now and then, I find myself in a situation where I wish I could also express this UNKNOWN or UNINITIALISED semantics in Java, when plain true and false aren't enough. Implementing … Continue reading Three-State Booleans in Java
jOOQ Newsletter: March 12, 2014
Subscribe to the newsletter here Tweet of the Day Our customers, users, and followers are sharing their love for jOOQ to the world. Here are: Dominik Dorn who finds jOOQ awesome. As simple as that! https://twitter.com/domdorn/status/434259335095410688 Mariusz Nosiński who cannot believe he hasn't discovered jOOQ before. https://twitter.com/marioosh/status/441475404579102720 Thanks for the shouts, guys! jOOQ and Scala In … Continue reading jOOQ Newsletter: March 12, 2014
Java 8 Friday Goodies: SQL ResultSet Streams
At Data Geekery, we love Java. And as we're really into jOOQ's fluent API and query DSL, we're absolutely thrilled about what Java 8 will bring to our ecosystem. We have blogged a couple of times about some nice Java 8 goodies, and now we feel it's time to start a new blog series, the... … Continue reading Java 8 Friday Goodies: SQL ResultSet Streams
