In a real Java project, almost every POJO class we create will have to add methods such as set/get/toString to its properties, and all logging classes will probably have to create objects such as logs. This boilerplate code is neither technical nor aesthetic. At the same time, the repetitive coding process will increase our workload unconsciously. That’s where Lombok came in.

Lombok is a third Java library that is automatically inserted into editors and build tools. Lombok provides a useful set of comments to tell the compiler during the build process to add some boilerplate code to the bytecode as the source code is compiled into bytecode.

The common annotation profiler @setter is used to generate Setter methods for the described class, without the final modifier attribute. The @getter is used to generate the Getter method for the described class. @ToString is used to add the ToString method to the described class. @EqualSandHashCode is used to generate the hashCode and equals methods for the described class. @NoArgsConstructor is used to generate a no-argument constructor for the class described. @AllArgsConstructor is used to generate a constructor for the class described that contains all the fields in the class. @data is used to generate setter/getter, equals, canEqual, hashCode, toString methods for the described class. If the property is final, no setter methods will be generated for the property. @slf4j is used to add a log property object for the described class.