lombok便捷set,get
依赖
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.20</version> <scope>provided</scope> </dependency>
使用
import lombok.Data; import lombok.Getter; import lombok.Setter; @Data //包含get和set @Setter @Getter public class User { private Long id; private String name; private String email; private String phone; }