Use Lombok to write clean POJO

Project Lombok

All Features at

Common Annotations

@Getter / @Setter
Auto generate the getter and setter method


Auto generate the toString() methed. The property includeFieldNames default value is false if using @Data annotation.


All together now: A shortcut for @ToString, @EqualsAndHashCode, @Getter on all fields, and @Setter on all non-final fields, and @RequiredArgsConstructor!

Working with Maven

TO include lombok as ‘provided’ dependency, add it to <dependencies> block:


Working with Eclipse

Dobule-click lombok.jar in eclipse project. It is in the Maven Dependencies classpath.

Please refer:

Written on November 17, 2021