Deserialize Immutable Objects with Jackson 1. Overview In this quick tutorial, we’ll show two different ways of deserializing immutable Java objects with the Jackson JSON processing library. 2. Why Do We Use Immutable Objects? An immutable object is an object that keeps its state intact since the very moment of… Continue Reading jackson-deserialize-immutable-objects

JUnit 5 Conditional Test Execution with Annotations 1. Overview In this tutorial, we’re going to take a look at conditional test execution with annotations in JUnit 5. These annotations are from the JUnit Jupiter library’s condition package and allow us to specify different types of conditions under which our tests should or… Continue Reading junit-5-conditional-test-execution

Introduction to JavaPoet 1. Overview In this tutorial, we’ll explore the basic functionalities of the JavaPoet library. JavaPoet is developed by Square, which provides APIs to generate Java source code. It can generate primitive types, reference types and their variants (such as classes, interfaces, enumerated types, anonymous inner classes), fields, methods, parameters,… Continue Reading java-poet

HTTPS using Self-Signed Certificate in Spring Boot 1. Overview In this tutorial, we’re going to illustrate step by step an example of enabling HTTPS in a Spring Boot application. We’ll generate a self-signed certificate and configure it in a sample app. For more details on Spring Boot projects, we can… Continue Reading spring-boot-https-self-signed-certificate

Calculate Percentage in Java 1. Introduction In this quick tutorial, we’re going to implement a CLI program to calculate percentage in Java. But first, let’s define how to calculate percentage mathematically. 2. Mathematical Formula In mathematics, a percentage is a number or ratio expressed as a fraction of 100. It’s often… Continue Reading java-calculate-percentage

Spring @RequestParam Annotation 1. Overview In this quick tutorial, we’ll explore Spring’s @RequestParam annotation. Simply put, we can use @RequestParam to extract query parameters, form parameters and even files from the request. We’ll discuss how to use @RequestParam and its attributes. We’ll also discuss the differences between @RequestParam and @PathVariable.… Continue Reading spring-request-param

Converting Between an Array and a Set in Java 1. Overview In this short article we’re going to look at converting between an array and a Set – first using plain java, then Guava and the Commons Collections library from Apache. This article is part of the “Java – Back… Continue Reading convert-array-to-set-and-set-to-array