Objective:
Lombok provides a simple form of annotations to help us simplify the removal of some of the necessary but bloated Java code. Especially with respect to POJO
Lombok Official Website: http://projectlombok.org/Official demo video teaches you how to use it quickly
Below are the Lombok used under different tools
Simply say the usage in eclipse
1. Download Lombok.jar Package https://projectlombok.org/download.html
2. Run Lombok.jar: Java -jar D:\software\lombok.jar
D:\software\lombok.jar This is the location under Windows Lombok.jar where you can choose an eclipse location after running
- 3. Add Lombokjar to your project
- 4. The reference diagram is as follows
- 5lombok Annotations:
Lombok offers a few annotations, and can refer to the official video commentary and official documentation.
Lombok Annotations Online Help documentation: Http://projectlombok.org/features/index.
Here are a few of the Lombok annotations I commonly use:
@Data: Annotations on classes; provides getting and setting methods for all properties of a class, plus equals, canequal, Hashcode, toString methods
@Setter: annotations are on attributes; Provides setting method for attributes
@Getter: annotations are on attributes; provides getting method for attributes
@Log4j: Annotations on a class; Provides a log4j log object with a property named log for the class
@NoArgsConstructor: Annotations on a class; provides an argument-free construction method for a class
@AllArgsConstructor: Annotations are on a class; Provides a method for constructing a full parameter for a class
Eclipse uses Lombok to streamline Java beans