Java Sort List of Objects with Comparable

This tutorial shows you way to Sort List of Objects using Comparable example.

Related Post: Java Sort List of Objects with Comparator

How to do this with Kotlin: Sort List of Objects with Comparable

[Continue reading…] “Java Sort List of Objects with Comparable”

Java Sort List of Objects with Comparator

This tutorial shows you way to Sort List of Objects by implementing Comparator example.

Related Post: Java Sort List of Objects with Comparable

How to do this with Kotlin: Sort List of Objects with Comparator

[Continue reading…] “Java Sort List of Objects with Comparator”

How to execute asynchronous query with Spring JPA and PostgreSQL | Spring Boot

In tradition approach, implementing Data Access Layer makes lots of boilerplate code. Spring Data provides us Spring JPA which supports the ways to write interface for repositories and custom finder methods. The implementation will be done automatically by Spring Framework.

The tutorial shows you how to execute asynchronous query with Spring JPA and PostgreSQL using Spring Boot.

Related articles:
Java 8 Streams
How to use Spring JPA MySQL | Spring Boot
How to use Spring JPA with PostgreSQL | Spring Boot
How to get streaming results with Spring JPA, Java 8 Stream and PostgreSQL | Spring Boot
@DataJPATest with Spring Boot

[Continue reading…] “How to execute asynchronous query with Spring JPA and PostgreSQL | Spring Boot”

How to get streaming results with Spring JPA, Java 8 Stream and PostgreSQL | Spring Boot

In tradition approach, implementing Data Access Layer makes lots of boilerplate code. Spring Data provides us Spring JPA which supports the ways to write interface for repositories and custom finder methods. The implementation will be done automatically by Spring Framework.

The tutorial shows you how to make streaming results with Spring JPA, Java 8 Stream and PostgreSQL using Spring Boot.

Related articles:
Java 8 Streams
How to use Spring JPA MySQL | Spring Boot
How to use Spring JPA with PostgreSQL | Spring Boot
@DataJPATest with Spring Boot

[Continue reading…] “How to get streaming results with Spring JPA, Java 8 Stream and PostgreSQL | Spring Boot”

Java 8 – How to convert List to Map & Map to List

In the tutorial, JavaSampleApproach will guide you How to convert List to Map (Map to List) with Java 8.

Related Posts:
1. Java 8 – Lambda Expressions
2. Java 8 – Functional Interfaces
3. Java 8 – Method References

[Continue reading…] “Java 8 – How to convert List to Map & Map to List”

How to use Java 8 Encode (Decode) an Image to Base64

For some purpose like transfering an image through RestfulAPI or saving an image to a DataBase, We need Encoder (Decode) the image to Base64. In the tutorial, JavaSampleApproach will guide you how to use Java 8 for converting.

Related post: Java 8 Base64

[Continue reading…] “How to use Java 8 Encode (Decode) an Image to Base64”

Java 8 Base64

Java 8 Base64 provides a standard way to do Base64 encoding and decoding.
There are three types of Base64 encoding:
Basic: Encoder produces a set of characters within A-Za-z0-9+/. Decoder rejects any character NOT mapped to A-Za-z0-9+/.
URL: Encoder produces a URL or safe filename which is set of characters within A-Za-z0-9+_.
MIME: Output is mapped to MIME friendly format.

[Continue reading…] “Java 8 Base64”

Java 8 Multiple CompletableFutures

In previous posts, we have concept of how to use CompletableFutures. This tutorial is about combining multiple CompletableFutures, it is one of the most important and useful abilities of Java 8 asynchronous processing.

Related articles:
Java Future
CompletableFutures
CompletableFuture Handle Exception

[Continue reading…] “Java 8 Multiple CompletableFutures”

Java 8 CompletableFuture Handle Exception

Exception handling is important in software development, Java 8 CompletableFuture also provides methods to handle errors when they occurs.

Related article:
Java Future
Java 8 CompletableFuture
Java 8 Multiple CompletableFutures

[Continue reading…] “Java 8 CompletableFuture Handle Exception”

Java 8 CompletableFutures

Java 8 multithreading programming has an important feature named CompletableFuture.
In previous post about Java Future, we have the concept of a Future object, which can help us make something done while waiting for other things. However, although we can inspect Future objects to see if they’re done, what if we wanna execute some code whenever its ready? We still have to wait until the result is available.

CompletableFuture meets the requirement, and more than that.

Related articles:
Java Future
CompletableFuture Handle Exception
Java 8 Multiple CompletableFutures

[Continue reading…] “Java 8 CompletableFutures”

Java 8 Streams

Java 8 comes with some prominent features like Lambda Expressions, Method References. And Streams are also an important concept that we should comprehend.

This tutorial will help you have a deep view of Java 8 Streams: what they are, ways to create them, how they work with intermediate operations, terminal operation…

[Continue reading…] “Java 8 Streams”

Java 8 – Method References

Method References make it clear when referring to the existing method by name.

In the article Lambda Expressions and Functional Interfaces, we use lambda expressions to create anonymous methods and sometimes, calling an existing method is the only thing it does.

When using lambda expression without input arguments or those input arguments doesn’t make sense, we can use Method References to simplify the syntax.

This tutorial introduces four kinds of Method References and how to use them efficiently with some Functional Interfaces.

[Continue reading…] “Java 8 – Method References”

Java 8 – Functional Interfaces

Functional Interfaces is one of the new important things of Java 8. In previous article, we had a little view about common use cases of Lambda Expression including Runnable and ActionListener. They are example of Functional Interfaces.

This tutorial helps you have deeper concept of Functional Interface, then some interfaces which are provided in java.util.function package such as Predicate and Function.

[Continue reading…] “Java 8 – Functional Interfaces”