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

Image may be NSFW.
Clik here to view.

Setting a Spring Bean to Null

1. Overview In this tutorial, we’ll learn how to set beans in the Spring context to nulls. This might be useful in some cases, such as testing when we don’t want to provide mocks. Also, while using...

View Article


Image may be NSFW.
Clik here to view.

Checking if an Object’s Type Is Enum

1. Overview When we work with Java, understanding and manipulating object types are fundamental skills. One common challenge is checking whether an object belongs to an Enum type. In this quick...

View Article


Image may be NSFW.
Clik here to view.

Java Weekly, Issue 517

1. Spring and Java >> How to cascade DELETE with Spring and Hibernate events [vladmihalcea.com] Taking advantage of Hibernate’s event listeners to cascade a DELETE operation to other entities...

View Article

Image may be NSFW.
Clik here to view.

Gradle Proxy Configuration

1. Overview A proxy server acts as an intermediary between a client and a server. It helps evaluate requests from a client before forwarding them to target servers based on certain criteria. This gives...

View Article

Image may be NSFW.
Clik here to view.

Return First Non-null Value in Java

1. Overview In this tutorial, we’ll learn how to return the first non-null element from a list or sequence of data. We’ll also explore lazy evaluation when returning the first non-null from a chain of...

View Article


Image may be NSFW.
Clik here to view.

Check Certificate Name and Alias in Keystore File

1. Overview In this tutorial, we’ll learn to check certificate names and aliases in a Java keystore file using the Java KeyStore API and the keytool utility. 2. Setup Before describing the two methods,...

View Article

Image may be NSFW.
Clik here to view.

Limiting the Max Size of a HashMap in Java

1. Overview HashMap is a well-known class from the Java Collections library. It implements the Map interface and allows the storage of key-value pairs. An instance of HashMap does not have a limitation...

View Article

Image may be NSFW.
Clik here to view.

Setup Asynchronous Retry Mechanism in Spring

1. Overview Sometimes, we require code execution to be asynchronous for better application performance and responsiveness. Also, we may want to automatically re-invoke the code on any exception, as we...

View Article


Image may be NSFW.
Clik here to view.

Modify Request Body Before Reaching Controller in Spring Boot

1. Overview In this tutorial, we’ll learn how to modify an HTTP request before it reaches the controller in a Spring Boot application. Web applications and RESTful web services often employ this...

View Article


Image may be NSFW.
Clik here to view.

Generating Unique Positive long Using UUID in Java

1. Overview UUID (Universally Unique Identifier) represents a 128-bit number that is designed to be globally unique. In practice, UUIDs are suitable for use in situations that require unique...

View Article

Image may be NSFW.
Clik here to view.

Passing JVM Options from Gradle bootRun

1. Overview Gradle is a multi-purpose automation build tool to develop, compile, and test software packages. It supports a wide range of languages, but primarily, we use it for Java-based languages...

View Article

Image may be NSFW.
Clik here to view.

How to Sort LinkedHashMap By Values in Java

1. Overview Map is a common data type when we need to manage key-value associations. The LinkedHashMap is a popular choice, primarily known for preserving the insertion order. However, in many...

View Article

Image may be NSFW.
Clik here to view.

Convert Long Timestamp to LocalDateTime in Java

1. Introduction 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 еxtеrnal...

View Article


Image may be NSFW.
Clik here to view.

How to Increment a Map Value in Java

1. Introduction In this tutorial, we’ll look at several ways to increment a numerical value associated with a key in a Map. The Maps interface, part of the Collections framework in Java, represents a...

View Article

Image may be NSFW.
Clik here to view.

How to Use a Custom Font in Java

1. Introduction Whеn wе dеvеlop our Java applications, wе may nееd to dеsign them with custom fonts to makе things appеar morе clear in GUI. Fortunately, Java has a wide range of fonts which comе by...

View Article


Image may be NSFW.
Clik here to view.

Java Weekly, Issue 518

1. Spring and Java >> JEP targeted to JDK 22: JEP 456: Unnamed Variables & Patterns [openjdk.org] The second preview of unnamed variables and patterns in Java 22: useful when we don’t need...

View Article

Image may be NSFW.
Clik here to view.

Convert Positive Integer to Negative and Vice Versa in Java

1. Overview In Java programming, understanding how to manipulate integers is fundamental to writing robust and efficient code. One common operation is negating an integer. In this tutorial, we’ll...

View Article


Image may be NSFW.
Clik here to view.

How to Convert Byte Array to Char Array

1. Introduction Convеrting bytеs to a charactеr array in Java involvеs transforming a sеquеncе of bytеs into its corrеsponding array of charactеrs. To bе spеcific, bytеs rеprеsеnt raw data, whеrеas...

View Article

Image may be NSFW.
Clik here to view.

Check if a double Is an Integer in Java

1. Overview Dealing with numerical data often requires precision handling. One common scenario arises when we need to check whether a double is, in fact, a mathematical integer. In this tutorial, we’ll...

View Article

Image may be NSFW.
Clik here to view.

Resolving Gson’s “Multiple JSON Fields” Exception

1. Overview Google Gson is a useful and flexible library for JSON data binding in Java. In most cases, Gson can perform data binding to an existing class with no modification. However, certain class...

View Article
Browsing all 3589 articles
Browse latest View live