// 字符串:判空、截取、正则匹配 boolean notEmpty = StrUtil.isNotEmpty("Hutool"); String sub = StrUtil.sub("Hello Hutool", 0, 5); List<String> matches = ReUtil.findAll("\\d+", "abc123xyz456", 0, new ArrayList<>());
DateUtil.parse(CharSequence dateStr) : Intelligently guesses the date format and parses it into a Date object.
: Real-time monitoring of vehicle voltage, topology mapping of communication status, and reading Diagnostic Trouble Codes (DTCs). ECU Programming
// Simple GET request String result = HttpUtil.get("https://google.com"); // POST with parameters HashMap paramMap = new HashMap<>(); paramMap.put("city", "New York"); String postResult = HttpUtil.post("https://weather.com", paramMap); Use code with caution. Copied to clipboard ⚠️ Important Note on Version 3.9
<dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>3.9.0</version> </dependency> hutool 39
Added a custom callback parameter to Server-Sent Events (SSE) functions. This enables seamless, real-time token streaming to frontend client UIs.
While MapStruct is great for complex mappings, sometimes you just need to convert a Map to a Bean or vice versa.
Designed to be a small library with no external dependencies, minimizing conflict issues.
Write defensive checks in one line. Throws IllegalArgumentException if condition fails. Copied to clipboard ⚠️ Important Note on Version 3
可以看到, 5.8.39 是一个在AI集成、性能、安全(脱敏)和稳定性多方面都得到增强的版本,这或许是很多开发者讨论“Hutool 39”时的真正所指。站在今天回看, 5.8.39 是Hutool走向功能完备、稳定可靠的里程碑。
is your cheat sheet for pragmatic Java. It’s not about memorizing APIs—it’s about recognizing that FileUtil , StrUtil , and HttpUtil should have been in the JDK from the start.
| 模块 | 功能描述 | |------|----------| | hutool-core | 核心模块,包含Bean操作、日期、各种Util等 | | hutool-crypto | 加密解密,提供对称、非对称和摘要算法封装 | | hutool-http | Http客户端封装,基于HttpUrlConnection | | hutool-db | JDBC封装后的数据操作,基于ActiveRecord思想 | | hutool-extra | 扩展模块,对模板引擎、邮件、二维码、FTP等的封装 | | hutool-poi | 针对POI中Excel和Word的封装 | | hutool-cache | 简单缓存实现 | | hutool-cron | 定时任务,提供类Crontab表达式的定时任务 | | hutool-captcha | 图片验证码实现 | | hutool-jwt | JSON Web Token (JWT)封装实现 |
FileUtil.readUtf8String(File file) : Reads an entire file directly into a clean UTF-8 String. Designed to be a small library with no
// #19, #22: Date parsing and age calculation DateTime birth = DateUtil.parse(birthStr); int age = DateUtil.ageOfNow(birth);
A lightweight HTTP client to send requests and download web resources without bulky external frameworks.
Performs file operations, path lookups, and directory creation in a single line of code.
MapUtil.newHashMap() : Instantiates a generic HashMap cleanly.