Eclipse uses Lombok to streamline Java beans

Source: Internet
Author: User

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

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.