lombok最全的,最新的学习资料,demo【最全的注解】打开蓝色注解链接
来源:互联网 发布:手机上淘宝店铺装修 编辑:程序博客网 时间:2024/06/13 06:40
面试的时候,有问起这个lombok是什么玩意儿? 当时没有使用过,感觉挺好奇的,简单研究了下
打开下方蓝色注解链接-有惊喜
lombok官方地址: https://projectlombok.org/download.html
使用Maven来添加支持
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.10</version>
</dependency>
使用idea插件,需要安装,设置下。
下面贴一些官网的demo:
val
- Finally! Hassle-free final local variables.
@NonNull
- or: How I learned to stop worrying and love the NullPointerException.
@Cleanup
- Automatic resource management: Call your
close()
methods safely with no hassle. @Getter
/@Setter
- Never write
public int getFoo() {return foo;}
again. @ToString
- No need to start a debugger to see your fields: Just let lombok generate a
toString
for you! @EqualsAndHashCode
- Equality made easy: Generates
hashCode
andequals
implementations from the fields of your object. @NoArgsConstructor
,@RequiredArgsConstructor
and@AllArgsConstructor
- Constructors made to order: Generates constructors that take no arguments, one argument per final / non-null field, or one argument for every field.
@Data
- All together now: A shortcut for
@ToString
,@EqualsAndHashCode
,@Getter
on all fields, and@Setter
on all non-final fields, and@RequiredArgsConstructor
! @Value
- Immutable classes made very easy.
@Builder
- ... and Bob's your uncle: No-hassle fancy-pants APIs for object creation!
@SneakyThrows
- To boldly throw checked exceptions where no one has thrown them before!
@Synchronized
synchronized
done right: Don't expose your locks.@Getter(lazy=true)
- Laziness is a virtue!
@Log
- Captain's Log, stardate 24435.7: "What was that line again?"
- Configuration system
- Lombok, made to order: Configure lombok features in one place for your entire project or even your workspace.
- Experimental features
- Here be dragons: Extra features which aren't quite ready for prime time yet.
0 0
- lombok最全的,最新的学习资料,demo【最全的注解】打开蓝色注解链接
- 分享一个最新最全的hadoop学习资料
- 基于全注解方式实现MyBatis链接数据库的demo
- 最全的机器学习资料汇总
- 据说是学习python最全的资料
- 最全的Vue学习资料
- 最新最全的嵌入式研发资料下载
- 最全的摄像头资料
- 全注解实现ssh的Demo实例
- 最新最全的ASP.NET学习资源大全
- 最新最全的ASP.NET学习资源大全
- 最新最全的ASP.NET学习资源大全
- 最新最全的ASP.NET学习资源大全
- 最全最新的java经典学习课件
- EXT4.0最新最全的视频教程
- 最新最全的css规范指南
- 转载:据说是学习python最全的资料
- 最全的acm资料web
- 使用SimpleAdapter时,支持的UI控件类型
- 如何保证service一直在后台运行
- OSATE2安装
- Python Socket编程:发送MIME协议邮件
- frameset —— 定义一个框架集
- lombok最全的,最新的学习资料,demo【最全的注解】打开蓝色注解链接
- 使用 jquery.easing.js 增强动画过渡效果
- 警告: 无法调试脚本代码。未注册正确的 pdm.dll 版本。请修复 Visual Studio 2005 安装或运行“regsvr32.exe "%CommonProgramFiles%\Micro
- C++友元
- Android App的设计架构:MVC,MVP,MVVM与架构经验谈
- Android音乐浮窗播放器
- java-栈、堆内存简单分析
- DevExpress XtraScheduler日程管理控件应用实例
- Linux 网络性能tuning向导