Using @EqualsAndHashCode.Exclude annotation

In this post under lombok, I will show with example the purpose of @EqualsAndHashCode.Exclude annotation. In the previous post, I explained with example the purpose of “@EqualsAndHashCode” annotation. It generates “equals” and “hashCode” method for the “@EqualsAndHashCode” annotated class. When generating “equals” and “hashCode” method it takes into consideration all the fields of the class.…… Continue reading Using @EqualsAndHashCode.Exclude annotation

Registering init and destroy methods using @Bean annotation

In this post under Spring Core, I will explain with example how to register initialization and destroy methods for a bean. FYI, a bean initialization method is called when the bean is created and destroy method is called before bean is garbage collected. All we need to tell Spring is which are the initialization and…… Continue reading Registering init and destroy methods using @Bean annotation

Uncompressing a gzip file

In this post under Java, I will show with example how to uncompress a gzip format file. For decompressing a gzip file, we will use java provided “GZIPInputStream” class. Below is the main code for your reference Main class 1 package zip; 2 3 import java.io.File; 4 import java.io.FileInputStream; 5 import java.io.FileOutputStream; 6 import java.io.IOException;…… Continue reading Uncompressing a gzip file