mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
change method name
This commit is contained in:
parent
af1d615ca9
commit
dca95552a8
161
CHANGELOG.md
161
CHANGELOG.md
@ -3,169 +3,10 @@
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# 5.8.0.M5 (2022-04-27)
|
# 6.0.0.M1 (2022-04-28)
|
||||||
|
|
||||||
### ❌不兼容特性
|
### ❌不兼容特性
|
||||||
* 【extra 】 升级jakarta.validation-api到3.x,包名变更导致不能向下兼容
|
|
||||||
|
|
||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
|
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
* 【db 】 修复RedisDS无法设置maxWaitMillis问题(issue#I54TZ9@Gitee)
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# 5.8.0.M4 (2022-04-27)
|
|
||||||
|
|
||||||
### ❌不兼容特性
|
|
||||||
* 【json 】 【可能兼容问题】JSONArray删除部分构造
|
|
||||||
* 【json 】 【可能兼容问题】JSONTokener使用InputStream作为源时,由系统编码变更为UTF-8
|
|
||||||
|
|
||||||
### 🐣新特性
|
|
||||||
* 【core 】 BeanUtil增加toBean重载(pr#598@Gitee)
|
|
||||||
* 【json 】 新增JSONParser
|
|
||||||
* 【json 】 JSON新增在解析时的过滤方法(issue#I52O85@Gitee)
|
|
||||||
* 【core 】 添加ArrayUtil.distinct、CollUtil.distinct重载(issue#2256@Github)
|
|
||||||
* 【core 】 添加TransMap、FuncMap、ReferenceConcurrentMap、WeakConcurrentMap
|
|
||||||
* 【json 】 添加ObjectMapper
|
|
||||||
* 【core 】 CHINESE_NAME正则条件放宽(pr#599@Gitee)
|
|
||||||
* 【extra 】 增加JakartaServletUtil(issue#2271@Github)
|
|
||||||
* 【poi 】 ExcelWriter支持重复别名的数据写出(issue#I53APY@Gitee)
|
|
||||||
* 【core 】 增加Hashids(issue#I53APY@Gitee)
|
|
||||||
* 【core 】 ReflectUtil.newInstanceIfPossible添加枚举、数组等类型的默认实现
|
|
||||||
* 【core 】 CombinationAnnotationElement增加过滤(pr#605@Gitee)
|
|
||||||
* 【all 】 精简CHANGELOG
|
|
||||||
* 【core 】 新增AnsiEncoder
|
|
||||||
* 【log 】 新增彩色日式输出风格ConsoleColorLog(pr#607@Gitee)
|
|
||||||
|
|
||||||
### 🐞Bug修复
|
|
||||||
* 【core 】 修复StrUtil.firstNonX非static问题(issue#2257@Github)
|
|
||||||
* 【core 】 修复SimpleCache线程安全问题
|
|
||||||
* 【core 】 修复ClassLoaderUtil中可能的关联ClassLoader错位问题
|
|
||||||
* 【extra 】 修复Sftp错误内容解析大小写问题(issue#I53GPI@Gitee)
|
|
||||||
* 【core 】 修复Tailer当文件内容为空时,会报异常问题(pr#602@Gitee)
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# 5.8.0.M3 (2022-04-14)
|
|
||||||
|
|
||||||
### ❌不兼容特性
|
|
||||||
* 【core 】 StreamProgress#progress方法参数变更为2个(pr#594@Gitee)
|
|
||||||
* 【core 】 SimpleCache的raw key使用Mutable
|
|
||||||
* 【core 】 ArrayUtil.join删除已经弃用的无用原始类型重载
|
|
||||||
* 【core 】 删除Holder类,ReUtil.extractMultiAndDelPre方法参数改为Mutable
|
|
||||||
|
|
||||||
### 🐣新特性
|
|
||||||
* 【core 】 CopyOptions支持以Lambda方式设置忽略属性列表(pr#590@Gitee)
|
|
||||||
* 【core 】 增加中文姓名正则及其校验(pr#592@Gitee)
|
|
||||||
* 【core 】 Snowflake支持sequence使用随机数(issue#I51EJY@Gitee)
|
|
||||||
* 【core 】 JarClassLoader增加构造(pr#593@Gitee)
|
|
||||||
* 【core 】 增加Pid,以便获取单例pid
|
|
||||||
* 【core 】 Img增加全覆盖水印pressTextFull(pr#595@Gitee)
|
|
||||||
* 【core 】 ByteUtil.numberToBytes增加Byte判断(issue#2252@Github)
|
|
||||||
* 【core 】 CopyOptions添加converter,可以自定义非全局类型转换
|
|
||||||
* 【core 】 添加了设置从绝对路径加载数据库配置文件的功能(pr#2253@Github)
|
|
||||||
|
|
||||||
### 🐞Bug修复
|
|
||||||
* 【core 】 修复UserAgentUtil识别Linux出错(issue#I50YGY@Gitee)
|
|
||||||
* 【poi 】 修复ExcelWriter.getDisposition方法生成错误(issue#2239@Github)
|
|
||||||
* 【core 】 修复UrlBuilder重复编码的问题(issue#2243@Github)
|
|
||||||
* 【http 】 修复HttpRequest中urlQuery,处理get请求参数的时候会导致空指针异常(pr#2248@Github)
|
|
||||||
* 【core 】 修复SimpleCache在get时未使用读锁可能导致的问题
|
|
||||||
* 【aop 】 修复JdkInterceptor before 方法拦截 return false 仍然执行了 after 的拦截问题(issue#I5237G@Gitee)
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# 5.8.0.M2 (2022-04-02)
|
|
||||||
|
|
||||||
### ❌不兼容特性
|
|
||||||
* 【extra 】 【可能兼容问题】BeanCopierCache的key结构变更
|
|
||||||
* 【http 】 【可能兼容问题】HttpInterceptor增加泛型标识,HttpRequest中配置汇总于HttpConfig
|
|
||||||
* 【core 】 【可能兼容问题】UrlQuery.addQuery参数2从String变更为Object
|
|
||||||
* 【core 】 【可能兼容问题】WorkbookUtil.createBook实现改为WorkbookFactory.create
|
|
||||||
|
|
||||||
### 🐣新特性
|
|
||||||
* 【core 】 MapUtil增加entry、ofEntries方法
|
|
||||||
* 【core 】 ZipWriter增加add方法重载
|
|
||||||
* 【core 】 IterUtil增加filtered,增加FilterIter(issue#2228)
|
|
||||||
* 【core 】 增加NodeListIter、ResettableIter
|
|
||||||
* 【crypto 】 HmacAlgorithm增加SM4CMAC(issue#2206@Github)
|
|
||||||
* 【http 】 增加HttpConfig,响应支持拦截(issue#2217@Github)
|
|
||||||
* 【core 】 增加BlockPolicy,ThreadUtil增加newFixedExecutor方法(pr#2231@Github)
|
|
||||||
* 【crypto 】 BCMacEngine、Mac、CBCBlockCipherMacEngine、SM4MacEngine(issue#2206@Github)
|
|
||||||
|
|
||||||
### 🐞Bug修复
|
|
||||||
* 【core 】 IdcardUtil#getCityCodeByIdCard位数问题(issue#2224@Github)
|
|
||||||
* 【core 】 修复urlWithParamIfGet函数逻辑问题(issue#I50IUD@Gitee)
|
|
||||||
* 【core 】 修复IoUtil.readBytes限制长度读取问题(issue#2230@Github)
|
|
||||||
* 【http 】 修复HttpRequest中编码对URL无效的问题(issue#I50NHQ@Gitee)
|
|
||||||
* 【poi 】 修复读取excel抛NPE错误(pr#2234@Github)
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# 5.8.0.M1 (2022-03-28)
|
|
||||||
|
|
||||||
### ❌不兼容特性
|
|
||||||
* 【db 】 【不向下兼容 】增加MongoDB4.x支持返回MongoClient变更(pr#568@Gitee)
|
|
||||||
* 【json 】 【可能兼容问题】修改JSONObject结构,继承自MapWrapper
|
|
||||||
* 【core 】 【可能兼容问题】BeanCopier重构,新建XXXCopier,删除XXXValueProvider
|
|
||||||
* 【core 】 【可能兼容问题】URLEncoder废弃,URLEncoderUtil使用RFC3986
|
|
||||||
* 【core 】 【可能兼容问题】Base32分离编码和解码,以便减少数据加载,支持Hex模式
|
|
||||||
* 【core 】 【可能兼容问题】Base58分离编码和解码
|
|
||||||
* 【core 】 【可能兼容问题】Base62分离编码和解码,增加inverted模式支持
|
|
||||||
* 【core 】 【兼容问题 】PunyCode参数由String改为Charsequence
|
|
||||||
* 【cron 】 【可能兼容问题】SimpleValueParser改名为AbsValueParser,改为abstract
|
|
||||||
* 【poi 】 【可能兼容问题】ExcelUtil.getBigWriter返回值改为BigExcelWriter
|
|
||||||
* 【core 】 【可能兼容问题】Opt.ofEmptyAble参数由List改为Collection子类(pr#580@Gitee)
|
|
||||||
* 【json 】 【可能兼容问题】JSON转Bean时,使用JSON本身的相关设置,而非默认(issue#2212@Github)
|
|
||||||
* 【json 】 【可能兼容问题】JSONConfig中isOrder废弃,默认全部有序
|
|
||||||
|
|
||||||
### 🐣新特性
|
|
||||||
* 【http 】 HttpRequest.form采用TableMap方式(issue#I4W427@Gitee)
|
|
||||||
* 【core 】 AnnotationUtil增加getAnnotationAlias方法(pr#554@Gitee)
|
|
||||||
* 【core 】 FileUtil.extName增加对tar.gz特殊处理(issue#I4W5FS@Gitee)
|
|
||||||
* 【crypto 】 增加XXTEA实现(issue#I4WH2X@Gitee)
|
|
||||||
* 【core 】 增加Table实现(issue#2179@Github)
|
|
||||||
* 【core 】 增加UniqueKeySet(issue#I4WUWR@Gitee)
|
|
||||||
* 【core 】 阿拉伯数字转换成中文对发票票面金额转换的扩展(pr#570@Gitee)
|
|
||||||
* 【core 】 ArrayUtil增加replace方法(pr#570@Gitee)
|
|
||||||
* 【core 】 CsvReadConfig增加自定义标题行行号(issue#2180@Github)
|
|
||||||
* 【core 】 FileAppender优化初始List大小(pr#2197@Github)
|
|
||||||
* 【core 】 Base32增加pad支持(pr#2195@Github)
|
|
||||||
* 【core 】 Dict增加setFields方法(pr#578@Gitee)
|
|
||||||
* 【db 】 新加db.meta的索引相关接口(pr#563@Gitee)
|
|
||||||
* 【db 】 Oracle中Column#typeName后的长度去掉(pr#563@Gitee)
|
|
||||||
* 【poi 】 优化ExcelReader,采用只读模式(pr#2204@Gitee)
|
|
||||||
* 【poi 】 优化ExcelBase,将alias放入
|
|
||||||
* 【poi 】 优化ExcelBase,将alias放入
|
|
||||||
* 【core 】 改进StrUtil#startWith、endWith性能
|
|
||||||
* 【cron 】 增加CronPatternParser、MatcherTable
|
|
||||||
* 【http 】 GlobalHeaders增加系统属性allowUnsafeServerCertChange、allowUnsafeRenegotiation
|
|
||||||
* 【http 】 UserAgentUtil 解析,增加MiUI/XiaoMi浏览器判断逻辑(pr#581@Gitee)
|
|
||||||
* 【core 】 FileAppender添加锁构造(pr#2211@Github)
|
|
||||||
* 【poi 】 ExcelReader增加构造(pr#2213@Github)
|
|
||||||
* 【core 】 MapUtil提供change函数,EnumUtil提供getBy函数,通过lambda进行枚举字段映射(pr#583@Gitee)
|
|
||||||
* 【core 】 CompareUtil增加comparingIndexed(pr#585@Gitee)
|
|
||||||
* 【db 】 DruidDataSource构建时支持自定义参数(issue#I4ZKCW@Gitee)
|
|
||||||
* 【poi 】 ExcelWriter增加addImg重载(issue#2218@Github)
|
|
||||||
* 【bloomFilter】 增加FuncFilter
|
|
||||||
* 【http 】 增加GlobalInterceptor(issue#2217)
|
|
||||||
|
|
||||||
### 🐞Bug修复
|
|
||||||
* 【core 】 修复ObjectUtil.hasNull传入null返回true的问题(pr#555@Gitee)
|
|
||||||
* 【core 】 修复NumberConverter对数字转换的问题(issue#I4WPF4@Gitee)
|
|
||||||
* 【core 】 修复ReflectUtil.getMethods获取接口方法问题(issue#I4WUWR@Gitee)
|
|
||||||
* 【core 】 修复NamingCase中大写转换问题(pr#572@Gitee)
|
|
||||||
* 【http 】 修复GET重定向时,携带参数问题(issue#2189@Github)
|
|
||||||
* 【core 】 修复FileUtil、FileCopier相对路径获取父路径错误问题(pr#2188@Github)
|
|
||||||
* 【core 】 修复CopyOptions中fieldNameEditor无效问题(issue#2202@Github)
|
|
||||||
* 【json 】 修复JSON对Map.Entry的解析问题
|
|
||||||
* 【core 】 修复MapConverter中map与map转换兼容问题
|
|
||||||
* 【poi 】 解决sax读取时,POI-5.2.x兼容性问题
|
|
||||||
* 【core 】 修复判断两段时间区间交集问题(pr#2210@Github)
|
|
||||||
* 【http 】 修复标签误删问题(issue#I4Z7BV@Gitee)
|
|
||||||
* 【core 】 修复Win下文件名带*问题(pr#584@Gitee)
|
|
||||||
* 【core 】 FileUtil.getMimeType增加rar、7z支持(issue#I4ZBN0@Gitee)
|
|
||||||
* 【json 】 JSON修复transient设置无效问题(issue#2212@Github)
|
|
||||||
* 【core 】 修复IterUtil.getElementType获取结果为null的问题(issue#2222@Github)
|
|
||||||
* 【core 】 修复农历转公历在闰月时错误(issue#I4ZSGJ@Gitee)
|
|
10
README-EN.md
10
README-EN.md
@ -82,26 +82,20 @@ Hutool exists to reduce code search costs and avoid bugs caused by imperfect cod
|
|||||||
A Java-based tool class for files, streams, encryption and decryption, transcoding, regular, thread, XML and other JDK methods for encapsulation,composing various Util tool classes, as well as providing the following modules:
|
A Java-based tool class for files, streams, encryption and decryption, transcoding, regular, thread, XML and other JDK methods for encapsulation,composing various Util tool classes, as well as providing the following modules:
|
||||||
|
|
||||||
| module | description |
|
| module | description |
|
||||||
| -------------------|-------------------------------------------------------------------------------------------------------------------------|
|
|----------------|---------------------------------------------------------------------------------------------------------------------|
|
||||||
| hutool-aop | JDK dynamic proxy encapsulation to provide non-IOC faceting support |
|
|
||||||
| hutool-bloomFilter | Bloom filtering to provide some Hash algorithm Bloom filtering |
|
|
||||||
| hutool-cache | Simple cache |
|
|
||||||
| hutool-core | Core, including Bean operations, dates, various Utils, etc. |
|
| hutool-core | Core, including Bean operations, dates, various Utils, etc. |
|
||||||
| hutool-cron | Task scheduling with Cron expressions |
|
| hutool-cron | Task scheduling with Cron expressions |
|
||||||
| hutool-crypto | Provides symmetric, asymmetric and digest algorithm encapsulation |
|
| hutool-crypto | Provides symmetric, asymmetric and digest algorithm encapsulation |
|
||||||
| hutool-db | Db operations based on ActiveRecord thinking. |
|
| hutool-db | Db operations based on ActiveRecord thinking. |
|
||||||
| hutool-dfa | DFA models, such as multi-keyword lookups |
|
|
||||||
| hutool-extra | Extension modules, third-party wrappers (template engine, mail, servlet, QR code, Emoji, FTP, word splitting, etc.) |
|
| hutool-extra | Extension modules, third-party wrappers (template engine, mail, servlet, QR code, Emoji, FTP, word splitting, etc.) |
|
||||||
| hutool-http | Http client |
|
| hutool-http | Http client |
|
||||||
| hutool-log | Log (facade) |
|
| hutool-log | Log (facade) |
|
||||||
| hutool-script | Script execution encapsulation, e.g. Javascript |
|
| hutool-script | Script execution encapsulation, e.g. Javascript |
|
||||||
| hutool-setting | Stronger Setting Profile tools and Properties tools |
|
| hutool-setting | Stronger Setting Profile tools and Properties tools |
|
||||||
| hutool-system | System parameter tools (JVM information, etc.) |
|
|
||||||
| hutool-json | JSON |
|
| hutool-json | JSON |
|
||||||
| hutool-captcha | Image Captcha |
|
|
||||||
| hutool-poi | Tools for working with Excel and Word in POI |
|
| hutool-poi | Tools for working with Excel and Word in POI |
|
||||||
| hutool-socket | Java-based tool classes for NIO and AIO sockets |
|
| hutool-socket | Java-based tool classes for NIO and AIO sockets |
|
||||||
| hutool-jwt | JSON Web Token (JWT) implement |
|
| hutool-swing | Swing and AWT tools |
|
||||||
|
|
||||||
Each module can be introduced individually, or all modules can be introduced by introducing `hutool-all` as required.
|
Each module can be introduced individually, or all modules can be introduced by introducing `hutool-all` as required.
|
||||||
|
|
||||||
|
20
README.md
20
README.md
@ -51,6 +51,7 @@
|
|||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
## 📚简介
|
## 📚简介
|
||||||
|
|
||||||
Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。
|
Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。
|
||||||
|
|
||||||
Hutool中的工具方法来自每个用户的精雕细琢,它涵盖了Java开发底层代码中的方方面面,它既是大型项目开发中解决小问题的利器,也是小型项目中的效率担当;
|
Hutool中的工具方法来自每个用户的精雕细琢,它涵盖了Java开发底层代码中的方方面面,它既是大型项目开发中解决小问题的利器,也是小型项目中的效率担当;
|
||||||
@ -75,29 +76,23 @@ Hutool的存在就是为了减少代码搜索成本,避免网络上参差不
|
|||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
## 🛠️包含组件
|
## 🛠️包含组件
|
||||||
|
|
||||||
一个Java基础工具类,对文件、流、加密解密、转码、正则、线程、XML等JDK方法进行封装,组成各种Util工具类,同时提供以下组件:
|
一个Java基础工具类,对文件、流、加密解密、转码、正则、线程、XML等JDK方法进行封装,组成各种Util工具类,同时提供以下组件:
|
||||||
|
|
||||||
| 模块 | 介绍 |
|
| 模块 | 介绍 |
|
||||||
| -------------------|---------------------------------------------------------------------------------- |
|
|----------------|------------------------------------------------|
|
||||||
| hutool-aop | JDK动态代理封装,提供非IOC下的切面支持 |
|
|
||||||
| hutool-bloomFilter | 布隆过滤,提供一些Hash算法的布隆过滤 |
|
|
||||||
| hutool-cache | 简单缓存实现 |
|
|
||||||
| hutool-core | 核心,包括Bean操作、日期、各种Util等 |
|
| hutool-core | 核心,包括Bean操作、日期、各种Util等 |
|
||||||
| hutool-cron | 定时任务模块,提供类Crontab表达式的定时任务 |
|
| hutool-cron | 定时任务模块,提供类Crontab表达式的定时任务 |
|
||||||
| hutool-crypto | 加密解密模块,提供对称、非对称和摘要算法封装 |
|
| hutool-crypto | 加密解密模块,提供对称、非对称和摘要算法封装 |
|
||||||
| hutool-db | JDBC封装后的数据操作,基于ActiveRecord思想 |
|
| hutool-db | JDBC封装后的数据操作,基于ActiveRecord思想 |
|
||||||
| hutool-dfa | 基于DFA模型的多关键字查找 |
|
|
||||||
| hutool-extra | 扩展模块,对第三方封装(模板引擎、邮件、Servlet、二维码、Emoji、FTP、分词等) |
|
| hutool-extra | 扩展模块,对第三方封装(模板引擎、邮件、Servlet、二维码、Emoji、FTP、分词等) |
|
||||||
| hutool-http | 基于HttpUrlConnection的Http客户端封装 |
|
| hutool-http | 基于HttpUrlConnection的Http客户端封装 |
|
||||||
| hutool-log | 自动识别日志实现的日志门面 |
|
| hutool-log | 自动识别日志实现的日志门面 |
|
||||||
| hutool-script | 脚本执行封装,例如Javascript |
|
|
||||||
| hutool-setting | 功能更强大的Setting配置文件和Properties封装 |
|
| hutool-setting | 功能更强大的Setting配置文件和Properties封装 |
|
||||||
| hutool-system | 系统参数调用封装(JVM信息等) |
|
|
||||||
| hutool-json | JSON实现 |
|
| hutool-json | JSON实现 |
|
||||||
| hutool-captcha | 图片验证码实现 |
|
|
||||||
| hutool-poi | 针对POI中Excel和Word的封装 |
|
| hutool-poi | 针对POI中Excel和Word的封装 |
|
||||||
| hutool-socket | 基于Java的NIO和AIO的Socket封装 |
|
| hutool-socket | 基于Java的NIO和AIO的Socket封装 |
|
||||||
| hutool-jwt | JSON Web Token (JWT)封装实现 |
|
| hutool-swing | Swing和JWT相关封装 |
|
||||||
|
|
||||||
可以根据需求对每个模块单独引入,也可以通过引入`hutool-all`方式引入所有模块。
|
可以根据需求对每个模块单独引入,也可以通过引入`hutool-all`方式引入所有模块。
|
||||||
|
|
||||||
@ -138,9 +133,11 @@ Hutool的存在就是为了减少代码搜索成本,避免网络上参差不
|
|||||||
## 📦安装
|
## 📦安装
|
||||||
|
|
||||||
### 🍊Maven
|
### 🍊Maven
|
||||||
|
|
||||||
在项目的pom.xml的dependencies中加入以下内容:
|
在项目的pom.xml的dependencies中加入以下内容:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
@ -149,6 +146,7 @@ Hutool的存在就是为了减少代码搜索成本,避免网络上参差不
|
|||||||
```
|
```
|
||||||
|
|
||||||
### 🍐Gradle
|
### 🍐Gradle
|
||||||
|
|
||||||
```
|
```
|
||||||
implementation 'cn.hutool:hutool-all:6.0.0.M1'
|
implementation 'cn.hutool:hutool-all:6.0.0.M1'
|
||||||
```
|
```
|
||||||
@ -165,7 +163,8 @@ implementation 'cn.hutool:hutool-all:6.0.0.M1'
|
|||||||
|
|
||||||
### 🚽编译安装
|
### 🚽编译安装
|
||||||
|
|
||||||
访问Hutool的Gitee主页:[https://gitee.com/dromara/hutool](https://gitee.com/dromara/hutool) 下载整个项目源码(v5-master或v5-dev分支都可)然后进入Hutool项目目录执行:
|
访问Hutool的Gitee主页:[https://gitee.com/dromara/hutool](https://gitee.com/dromara/hutool)
|
||||||
|
下载整个项目源码(v5-master或v5-dev分支都可)然后进入Hutool项目目录执行:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./hutool.sh install
|
./hutool.sh install
|
||||||
@ -193,7 +192,6 @@ Hutool的源码分为两个分支,功能如下:
|
|||||||
- [Gitee issue](https://gitee.com/dromara/hutool/issues)
|
- [Gitee issue](https://gitee.com/dromara/hutool/issues)
|
||||||
- [Github issue](https://github.com/dromara/hutool/issues)
|
- [Github issue](https://github.com/dromara/hutool/issues)
|
||||||
|
|
||||||
|
|
||||||
### 🧬贡献代码的步骤
|
### 🧬贡献代码的步骤
|
||||||
|
|
||||||
1. 在Gitee或者Github上fork项目到自己的repo
|
1. 在Gitee或者Github上fork项目到自己的repo
|
||||||
|
@ -147,7 +147,7 @@ public class DateUtil extends CalendarUtil {
|
|||||||
*
|
*
|
||||||
* @return 当前时间的标准形式字符串
|
* @return 当前时间的标准形式字符串
|
||||||
*/
|
*/
|
||||||
public static String now() {
|
public static String formatNow() {
|
||||||
return formatDateTime(new DateTime());
|
return formatDateTime(new DateTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ public class DateUtil extends CalendarUtil {
|
|||||||
*
|
*
|
||||||
* @return 当前日期的标准形式字符串
|
* @return 当前日期的标准形式字符串
|
||||||
*/
|
*/
|
||||||
public static String today() {
|
public static String formatToday() {
|
||||||
return formatDate(new DateTime());
|
return formatDate(new DateTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -804,7 +804,7 @@ public class DateUtil extends CalendarUtil {
|
|||||||
* @since 3.1.1
|
* @since 3.1.1
|
||||||
*/
|
*/
|
||||||
public static DateTime parseTimeToday(CharSequence timeString) {
|
public static DateTime parseTimeToday(CharSequence timeString) {
|
||||||
timeString = StrUtil.format("{} {}", today(), timeString);
|
timeString = StrUtil.format("{} {}", formatNow(), timeString);
|
||||||
if (1 == StrUtil.count(timeString, ':')) {
|
if (1 == StrUtil.count(timeString, ':')) {
|
||||||
// 时间格式为 HH:mm
|
// 时间格式为 HH:mm
|
||||||
return parse(timeString, DatePattern.NORM_DATETIME_MINUTE_PATTERN);
|
return parse(timeString, DatePattern.NORM_DATETIME_MINUTE_PATTERN);
|
||||||
|
@ -1877,7 +1877,7 @@ public class CharSequenceUtil {
|
|||||||
* @return 截取后的字符串数组
|
* @return 截取后的字符串数组
|
||||||
* @see StrSplitter#splitByLength(CharSequence, int)
|
* @see StrSplitter#splitByLength(CharSequence, int)
|
||||||
*/
|
*/
|
||||||
public static String[] split(CharSequence str, int len) {
|
public static String[] splitToArray(CharSequence str, int len) {
|
||||||
return StrSplitter.splitByLength(str, len);
|
return StrSplitter.splitByLength(str, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,10 +49,10 @@ public class DateUtilTest {
|
|||||||
Assert.assertNotNull(date3);
|
Assert.assertNotNull(date3);
|
||||||
|
|
||||||
// 当前日期字符串,格式:yyyy-MM-dd HH:mm:ss
|
// 当前日期字符串,格式:yyyy-MM-dd HH:mm:ss
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.formatNow();
|
||||||
Assert.assertNotNull(now);
|
Assert.assertNotNull(now);
|
||||||
// 当前日期字符串,格式:yyyy-MM-dd
|
// 当前日期字符串,格式:yyyy-MM-dd
|
||||||
String today = DateUtil.today();
|
String today = DateUtil.formatToday();
|
||||||
Assert.assertNotNull(today);
|
Assert.assertNotNull(today);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,10 +27,10 @@ public class ConcurrencyTesterTest {
|
|||||||
Console.log("开始执行第{}个",i);
|
Console.log("开始执行第{}个",i);
|
||||||
ct.test(() -> {
|
ct.test(() -> {
|
||||||
// 需要并发测试的业务代码
|
// 需要并发测试的业务代码
|
||||||
Console.log("当前执行线程:" + Thread.currentThread().getName()+" 产生时间 "+ DateUtil.now());
|
Console.log("当前执行线程:" + Thread.currentThread().getName()+" 产生时间 "+ DateUtil.formatNow());
|
||||||
ThreadUtil.sleep(RandomUtil.randomInt(1000, 3000));
|
ThreadUtil.sleep(RandomUtil.randomInt(1000, 3000));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Console.log("全部线程执行完毕 "+DateUtil.now());
|
Console.log("全部线程执行完毕 "+DateUtil.formatNow());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ public class TestJob {
|
|||||||
*/
|
*/
|
||||||
public void doTest() {
|
public void doTest() {
|
||||||
// String name = Thread.currentThread().getName();
|
// String name = Thread.currentThread().getName();
|
||||||
Console.log("Test Job {} running... at {}", jobId, DateUtil.now());
|
Console.log("Test Job {} running... at {}", jobId, DateUtil.formatNow());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,7 +17,7 @@ public class CronPatternTest {
|
|||||||
CronPattern pattern;
|
CronPattern pattern;
|
||||||
// 任何时间匹配
|
// 任何时间匹配
|
||||||
pattern = CronPattern.of("* * * * * *");
|
pattern = CronPattern.of("* * * * * *");
|
||||||
assertMatch(pattern, DateUtil.now());
|
assertMatch(pattern, DateUtil.formatNow());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -394,7 +394,7 @@ public class JSONObjectTest {
|
|||||||
.set("name", "nameValue")
|
.set("name", "nameValue")
|
||||||
.set("date", "08:00:00");
|
.set("date", "08:00:00");
|
||||||
UserA bean = JSONUtil.toBean(userAJson.toString(), UserA.class);
|
UserA bean = JSONUtil.toBean(userAJson.toString(), UserA.class);
|
||||||
Assert.assertEquals(DateUtil.today() + " 08:00:00", DateUtil.date(bean.getDate()).toString());
|
Assert.assertEquals(DateUtil.formatToday() + " 08:00:00", DateUtil.date(bean.getDate()).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -82,6 +82,6 @@ public class ConsoleColorLog extends ConsoleLog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String template = AnsiEncoder.encode(COLOR_TIME, "[%s]", colorFactory.apply(level), "[%-5s]%s", COLOR_CLASSNAME, "%-30s: ", COLOR_NONE, "%s%n");
|
final String template = AnsiEncoder.encode(COLOR_TIME, "[%s]", colorFactory.apply(level), "[%-5s]%s", COLOR_CLASSNAME, "%-30s: ", COLOR_NONE, "%s%n");
|
||||||
System.out.format(template, DateUtil.now(), level.name(), " - ", ClassUtil.getShortClassName(getName()), StrUtil.format(format, arguments));
|
System.out.format(template, DateUtil.formatNow(), level.name(), " - ", ClassUtil.getShortClassName(getName()), StrUtil.format(format, arguments));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ public class ConsoleLog extends AbstractLog {
|
|||||||
|
|
||||||
|
|
||||||
final Dict dict = Dict.create()
|
final Dict dict = Dict.create()
|
||||||
.set("date", DateUtil.now())
|
.set("date", DateUtil.formatNow())
|
||||||
.set("level", level.toString())
|
.set("level", level.toString())
|
||||||
.set("name", this.name)
|
.set("name", this.name)
|
||||||
.set("msg", StrUtil.format(format, arguments));
|
.set("msg", StrUtil.format(format, arguments));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user