Recently the company used to Lombok, feel very good look, so the Internet search some information, summed up the use.

Source: Internet
Author: User

    1. 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.
    2. Official: http://projectlombok.org/
    3. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.