安装:
- 在IDEA中安装Lombok
file->settings->plugins-> ![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/4e30ce00b1468fb3e148850acd6a1cb2.png)
使用:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
</dependency>
@Getter and @Setter
@FieldNameConstants
@ToString
@EqualsAndHashCode
@AllArgsConstructor, @RequiredArgsConstructor and @NoArgsConstructor
@Log, @Log4j, @Log4j2, @Slf4j, @XSlf4j, @CommonsLog, @JBossLog, @Flogger, @CustomLog
@Data
@Builder
@SuperBuilder
@Singular
@Delegate
@Value
@Accessors
@Wither
@With
@SneakyThrows
- @Data
无参构造,get,set,tostring,hashcode,equals - @AllArgsConstructor
有参构造 - @NoArgsConstructor
无参构造
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/bb0ebac67a33950136009a6d2d3a7c66.png)