Using @ToString annotation

In this post under Lombok, I will show with example the purpose of @ToString annotation and how to use it. This annotation is applied at class level. When applied it instructs Lombok to consider all the non-static fields in a class and generate a “toString” function. When the output of Lombok generated “toString” function is…… Continue reading Using @ToString annotation

Overriding class level Getter and Setter annotations with method level Getter and Setter annotations

In this post under Lombok, I will show how we can override Getter and Setter annotations (applied at class level) default settings by appliying same annotationsat method level. Below is the example of pojo class for your reference. 1 package package3; 2 3 import java.util.Date; 4 5 import lombok.AccessLevel; 6 import lombok.Getter; 7 import lombok.Setter;…… Continue reading Overriding class level Getter and Setter annotations with method level Getter and Setter annotations

Getter and Setter annotations with AccessLevel

In previous post under Lombok, I showed how to inform Lombok to generate getter and setter methods automatically. By default getter and setter methods generated by Lombok have public access modifier. We can change the access modifier by taking help of “AccessLevel” attribute as shown below. 1 package package2; 2 3 import lombok.AccessLevel; 4 import…… Continue reading Getter and Setter annotations with AccessLevel

Registering Filters per JAX-RS client

In this post under JAX-RS Client, I will show with example how to configure filters per client. For our example we need to create two filters one to intercept requests and another to intercept responses as shown below Request Filter package defaultPackage; import java.io.IOException; import jakarta.ws.rs.client.ClientRequestContext; import jakarta.ws.rs.client.ClientRequestFilter; import jakarta.ws.rs.ext.Provider; public class MyClientRequestFilter implements ClientRequestFilter…… Continue reading Registering Filters per JAX-RS client

JAX-RS Client Connect Timeout

In this post under JAX-RS client, I will show with example how to set connect timeout. Below is the complete code for your reference Main Class 1 package defaultPackage; 2 3 import java.util.concurrent.TimeUnit; 4 5 import jakarta.ws.rs.client.Client; 6 import jakarta.ws.rs.client.ClientBuilder; 7 import jakarta.ws.rs.client.Invocation; 8 import jakarta.ws.rs.client.WebTarget; 9 import jakarta.ws.rs.core.Response; 10 11 public class Example14 {…… Continue reading JAX-RS Client Connect Timeout

JAX-RS Client Read Timeout

In this post under JAX-RS client, I will show with example how to set read timeout. Below is the complete code for your reference Main Class 1 package defaultPackage; 2 3 import java.util.concurrent.TimeUnit; 4 5 import jakarta.ws.rs.client.Client; 6 import jakarta.ws.rs.client.ClientBuilder; 7 import jakarta.ws.rs.client.Invocation; 8 import jakarta.ws.rs.client.WebTarget; 9 import jakarta.ws.rs.core.Response; 10 11 public class Example13 {…… Continue reading JAX-RS Client Read Timeout

Creating a header and footer for a worksheet

In this post under Apache excel, I will show with example how to add header and footer to an Worksheet. Below is the complete code for your reference. Main Class 1 package package5; 2 3 import java.io.BufferedReader; 4 import java.io.File; 5 import java.io.FileOutputStream; 6 import java.io.FileReader; 7 import java.io.IOException; 8 9 import org.apache.poi.xssf.usermodel.XSSFCell; 10 import…… Continue reading Creating a header and footer for a worksheet