050_Lombok


简介

Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java.
Never write another getter or equals method again, with one annotation your class has a fully featured builder, Automate your logging variables, and much more.
ProjectLombok是一个Java库,它自动插入编辑器并构建工具,为Java添加香料。
永远不要再编写另一个getter或Eques方法,您的类有一个功能齐全的构建器,可以自动化您的日志变量以及更多的注释。

idea使用Lombok

安装lombok插件

image.png

pom.xml添加依赖

<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.20</version>
    <scope>provided</scope>
</dependency>
 

实体类添加注解

package com.qing.pojo;

import lombok.Data;

/**
 * 实体类
 */
@Data
public class User {

    private int id;
    private String name;
    private String pwd;

}

image.png
image.png

posted @ 2021-07-11 18:25  清风(学习-踏实)  阅读(46)  评论(0编辑  收藏  举报