- Lombok Effect: It 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.
- Official: http://projectlombok.org/
- Installation:
(1) Copy the Lombok.jar to the directory where the Eclipse.ini/myeclipse.ini resides
(2) Open Eclipse.ini/myeclipse.ini, insert the following two lines on the last side and save:
-xbootclasspath/a:lombok.jar
-javaagent:lombok.jar
(3) Restart Eclispe/myeclipse
4. Lombok annotations (note the need to introduce Lombok.jar in the project):
Lombok annotations Online Help documentation: Http://projectlombok.org/features/index
Common annotations:
@Data: Annotations provide getter and setter methods for all properties of the class on the class, plus the Equals, canequal, Hashcode, ToString methods
@Setter: Annotations on attributes, providing Setter methods for attributes
@Getter: Annotations on attributes, providing Getter methods for attributes
@Log4j: Annotations on a class, provide a log4j log object with a property named log for the class
@NoArgsConstructor: Annotations on a class, provide an argument-free construction method for the class
@AllArgsConstructor: Annotations on a class, provides a method for constructing a full parameter for a class
Recently the company used to Lombok, feel very good look, so the Internet search some information, summed up the use.