Home » Tag Archives: Java 8 (page 6)

Tag Archives: Java 8

Java 8 Streams: Micro Katas

java-logo

A programming kata is an exercise which helps a programmer hone his skills through practice and repetition. This article is part of the series Java Tutorial Through Katas. The article assumes that the reader already has experience with Java, that he is familiar with the basics of unit tests and that he knows how to run them from his favorite ...

Read More »

Spring Boot / Java 8 / Tomcat 8 on Openshift with DIY

apache-tomcat-logo

DIY cartridge is an experimental cartridge that provides a way to test unsupported languages on OpenShift. It provides a minimal, free-form scaffolding which leaves all details of the cartridge to the application developer. This blog post illustrates the use of Spring Boot / Java 8 / Tomcat 8 application with PostgreSQL service bound to it. Creating new application Prerequisite Before ...

Read More »

Let’s Stream a Map in Java 8 with jOOλ

jool-logo

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 ...

Read More »

Don’t Miss out on Writing Java 8 SQL One-Liners with jOOλ or jOOQ

jooq-2-logo

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 that the JDK offers as ...

Read More »

Optional and Objects: Null Pointer Saviours!

java-logo

No one loves Null Pointer Exceptions ! Is there a way we can get rid of them ? Maybe . . .                    Couple of techniques have been discussed in this post: Optional type (new in Java 8) Objects class (old Java 7 stuff !) Optional type in Java 8 What is it? A ...

Read More »

Asynchronous SQL Execution with jOOQ and Java 8’s CompletableFuture

jooq-2-logo

Reactive programming is the new buzzword, which essentially just means asynchronous programming or messaging. Fact is that functional syntax greatly helps with structuring asynchronous execution chains, and today, we’ll see how we can do this in Java 8 using jOOQ and the new CompletableFuture API. In fact, things are quite simple:       // Initiate an asynchronous call chain ...

Read More »

How Nashorn Impacts API Evolution on a New Level

java-logo

Following our previous article about how to use jOOQ with Java 8 and Nashorn, one of our users discovered a flaw in using the jOOQ API as discussed here on the user group. In essence, the flaw can be summarised like so:               Java code package org.jooq.nashorn.test; public class API { public static void ...

Read More »

When the Java 8 Streams API is not Enough

java-logo

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 methods … “synchronized” is not ...

Read More »

Date/Time Formatting/Parsing, Java 8 Style

java-logo

Since nearly the beginning of Java, Java developers have worked with dates and times via the java.util.Date class (since JDK 1.0) and then the java.util.Calendar class (since JDK 1.1). During this time, hundreds of thousands (or maybe millions) of Java developers have formatted and parsed Java dates and times using java.text.DateFormat and java.text.SimpleDateFormat. Given how frequently this has been done ...

Read More »

Java 8 : Functional VS Traditional

java-logo

The business logic is the same : Given a String expression composed of visits / time like : “1/24h,1..3/3h,5/*” Then the result should be the following list of Strings: “1/24h”, “1/3h”,”2/3h”,”3/3h”, “5/1h”,”5/2h”,”5/3h”,”5/4h”,”5/5h”,until ,”24/1h” So, 2 things need to be solved, the dots and the stars for the visits and for the time. I will use Java 8 , but  I’ll ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.