The Assert tool class now includes a new method to ( Assert.isEmpty(Collection<?> collection) ). This simplifies defensive programming and reduces boilerplate null-check and size-check logic.
Hutool涵盖了字符串处理、数字计算、集合操作、日期时间、编码转换、文件IO、加密解密、数据库JDBC、JSON解析、HTTP客户端、图片验证码、布隆过滤器以及定时任务等一系列功能模块。它既适合大型项目中解决各类细碎问题,也适用于小型项目快速搭建,作为项目中原有util包的绝佳替代。
ImgUtil.scale(FileUtil.file("origin.jpg"), FileUtil.file("thumb.jpg"), 0.5f); hutool 39
Hutool is designed to replace the messy util packages found in most projects. It is organized into modular components, so you only need to import what you use.
// With Hutool 3.9 – 6 lines String csvData = HttpUtil.get("https://example.com/data.csv"); List<String> lines = StrUtil.split(csvData, '\n'); List<String> filtered = CollUtil.filter(lines, line -> line.contains("active")); FileUtil.writeLines(filtered, "/tmp/filtered.csv", CharsetUtil.UTF_8); The Assert tool class now includes a new method to ( Assert
The 5.8.x series has been battle-tested in countless production environments.
A high-performance JSON parsing and serialization component built to transition fluidly to and from native Java Beans. It is organized into modular components, so you
Decreased CPU instruction latency during map transformations. Fixed standard Thread Pools Custom RecyclableBatchThreadPoolExecutor
A simplified wrapper for standard cryptography routines, allowing developers to execute symmetric (AES, DES), asymmetric (RSA), and hashing algorithms (MD5, SHA-256) seamlessly.
Hutool is built on the philosophy of making Java "sweet" and functional-style, focusing on three main goals:
// No more nested ifs boolean empty = StrUtil.isBlank(" "); // true String fixed = StrUtil.fillBefore("123", '0', 5); // 00123 String cleaned = StrUtil.cleanChars("a+b*c", '+', '*'); // abc