当前位置:网站首页>开源框架对Range模式的支持
开源框架对Range模式的支持
2022-06-10 03:11:00 【李桥s2008100262】
目录
1、问题背景
在我们的项目当中,经常会有对一个范围区间的需求,在方法签名中,经常要传入一个开始日期、结束日期,并且,需要判断一个指定的日期是否在一个日期范围当中,这种需求使得我们非常
有必要Extract Class来提炼一个范围对象出来,为了实现这个需求,很多开源框架都提供了比较好的支持,他们通常提供了一些常见的范围对象,并且方便我们自己去自由的扩展,至少一般是提供了一个良好的继承体系。
2、apache commons类库对Range支持
Range只提供了对Number类型的支持,如果需要支持DateRange需要我们自己扩展。


3、hutool类库对Range支持

4、guava类库对Range支持
guava只提供了一个类就完成了对Range的支持。

5、总结
guava类库对Range的支持最为简单,只提供了一个类Range,都是工厂方法或者工具方法,
外部依赖非常少。
边栏推荐
- 1px problem
- EasyExcel 实现动态导入导出
- P1516 frog's date (expanding Europe)
- Cancel printing useless information in tensorflow, such as tensorflow:autograph could not transform < *> and will run it as is, loading CUDA information, etc
- Distributed data object: HyperTerminal 'global variable'
- generate for 和 for 区别
- JS memory leak
- IDEA同一套代码启动多个服务
- signed、unsigne整形在内存的存储
- Development of direct interface
猜你喜欢
随机推荐
Microgrid digital twin 𞓜 intelligent era, deploy the integrated control platform of source network load and storage
Do not show browser running when using webdriver
Understand IPS and IDS
扩展欧几里得模板+例题
Will free price increases force young people back?
三个月GMV6000w+,盘点家纺行业打造爆款的关键
Lua的模块和包
Detailed explanation of zero copy principle
剑指 Offer 30. 包含 min 函数的栈
IDEA同一套代码启动多个服务
Knight Moves
TS 23.122
Electronic packaging error NPM err! code ELIFECYCLE npm ERR! errno 1
How to extract public dependency Libraries
Tensorflow. Mobilenet for getting started with JS
1px问题
Xmake v2.6.6 發布,分布式編譯和緩存支持
单条视频播放量破8000w,硬核做饭原来如此上头
P1082 [NOIP2012 提高组] 同余方程
Pandas connection database read / write file









