Quantcast
Channel: Baeldung
Browsing all 3605 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

How to Implement Elvis Operator in Java 8

1. Introduction In Java 8, there is no built-in Elvis operator like in Groovy or Kotlin. However, we can implement our own Elvis operator using method references and the ternary operator. In this...

View Article


Image may be NSFW.
Clik here to view.

Casting Maps to Complex Objects

1. Overview Manipulating and reconstructing data is often a crucial part of programming in Java. One powerful technique involves casting Map objects into complex objects or POJOs. This can allow us to...

View Article


Image may be NSFW.
Clik here to view.

Avoiding the IndexOutOfBoundsException When Using List.subList() in Java

1. Overview In this short tutorial, we’ll learn how to avoid IndexOutOfBoundsException when working with the subList() method provided by the List interface. Initially, we’ll discuss how subList()...

View Article

Image may be NSFW.
Clik here to view.

Get the Position of Key/Value in LinkedHashMap Using Its Key

1. Introduction The LinkedHashMap class provides a convenient way to maintain the insertion order of key-value pairs while still offering the functionality of a HashMap. In this tutorial, we’ll explore...

View Article

Image may be NSFW.
Clik here to view.

How to Convert Between java.sql.Timestamp and ZonedDateTime in Java

1. Overview Handling timеstamps in Java is a common task that allows us to manipulatе and display datе and timе information morе еffеctivеly еspеcially when we’re dealing with databasеs or global...

View Article


Image may be NSFW.
Clik here to view.

Collecting into Map using Collectors.toMap() vs Collectors.groupingBy()

1. Overview In Java programming, working with collections and streams is a common task, especially in modern, functional programming paradigms. Java 8 introduced the Stream API, which provides powerful...

View Article

Image may be NSFW.
Clik here to view.

Fix Spring Boot H2 JdbcSQLSyntaxErrorException “Table not found”

1. Introduction H2 provides a simple in-memory and lightweight database that Spring Boot can configure automatically, making it easy for developers to test data access logic. Typically,...

View Article

Image may be NSFW.
Clik here to view.

Save Child Objects Automatically Using JPA

1. Overview Sometimes we deal with entities with complex models consisting of parent and child elements. In this scenario, it can be beneficial to save the parent entity, thereby automatically saving...

View Article


Image may be NSFW.
Clik here to view.

OpenAPI Custom Generator

1. Introduction In this tutorial, we’ll continue to explore OpenAPI Generator‘s customization options. This time, we’ll show how the required steps to create a new generator that creates REST Producer...

View Article


Image may be NSFW.
Clik here to view.

Converting short to byte[] in Java

1. Introduction Converting a short value to a byte[] array is a common task in Java programming, especially when dealing with binary data or network communication. In this tutorial, we’ll explore...

View Article

Image may be NSFW.
Clik here to view.

Inheritance vs. Composition in JPA

1. Introduction Inheritance and composition are two fundamental concepts in object-oriented programming (OOP) that we can also leverage in JPA for data modeling. In JPA, both inheritance and...

View Article

Image may be NSFW.
Clik here to view.

Full and Partial Text Search in MongoDB

1. Introduction The need for fast and efficient text searches often arises when developing database applications. They should also support full and partial text matches to make these searches even more...

View Article

Image may be NSFW.
Clik here to view.

Using Reactor Mono.cache() for Memoization

1. Overview Optimizing code for performance is a key part of programming, especially when dealing with expensive operations or data retrieval processes.  One effective way of improving performance is...

View Article


Image may be NSFW.
Clik here to view.

Convert an Optional to an ArrayList in Java

1. Introduction Java introduced the Optional class in Java 8 to represent a value that may or may not be present. It helps us to avoid NullPointerException and write more expressive and readable code....

View Article

Image may be NSFW.
Clik here to view.

How to Iterate a List of Maps in Java

1. Introduction In Java programming, dealing with collections is a fundamental task. Lists and Maps are two commonly used collection types, and sometimes, we might need to work with a List of Maps....

View Article


Image may be NSFW.
Clik here to view.

Convert Jackson JsonNode to Typed Collection

1. Overview In this tutorial, we’ll explore different methods of converting Jackson’s raw data type JsonNode into typed Java collections. While we can read JSON using JsonNode itself, converting it to...

View Article

Image may be NSFW.
Clik here to view.

Convert a Queue to a List

1. Overview In this tutorial, we’ll learn how to convert a Queue object into a List in Java. We’ll explain several popular ways of doing this along with their implementations, and we’ll end each...

View Article


Image may be NSFW.
Clik here to view.

Java Weekly, Issue 541

1. Spring and Java >> This is not your uncle’s Java! Modelling with Java 22 records pattern matching in practice [event-driven.io] Java has come a long way, but it was definitely worth the wait!...

View Article

Image may be NSFW.
Clik here to view.

Perform Action Only if All Optionals Are Available

1. Introduction Null references and values have tormented programmers for years. Tony Hoare, the creator of null references, famously called his invention a “billion-dollar mistake.” Java, in...

View Article

Image may be NSFW.
Clik here to view.

How to Convert Between ZonedDateTime and Date in Java

1. Overview When working with Java applications that handle date and time, understanding how to convert between different types is often essential. In this tutorial, we’ll explore how to convert...

View Article
Browsing all 3605 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>