Introduction
Hutool is a small and comprehensive Java tool class library. Through static method encapsulation, it reduces the learning cost of related APIs and improves work efficiency, so that Java has the elegance of a functional language, and the Java language can also be "sweet".
The tools and methods in Hutool come from the meticulous crafting of each user. It covers all aspects of the underlying code of Java development. It is not only a tool for solving small problems in large-scale project development, but also an efficiency responsibility in small projects;
Hutool is a friendly alternative to the "util" package in the project. It saves developers the encapsulation time of public classes and public tool methods in the project, enables development to focus on business, and avoids bugs caused by imperfect encapsulation.
The origin of the name Hutool
Hutool = Hu + tool, is an open source library after stripping the underlying code of the original company project. "Hu" is the name of the company, and tool is the tool. Hutool is homophonic "confused", on the one hand it is concise and easy to understand, on the other hand it means "rarely confused".
How Hutool changed our coding method
Hutool's goal is to use a tool method to replace a piece of complex code, so as to avoid the problem of "copy and paste" code to the greatest extent, and completely change the way we write code.
Take the calculation of MD5 as an example:
- [Before] Open the search engine -> search for "Java MD5 encryption" -> open a blog -> copy and paste -> change it to use
- [Now] Introduce Hutool -> SecureUtil.md5()
Hutool exists to reduce code search costs and avoid bugs caused by uneven code on the Internet.
Include components
A Java basic tool class that encapsulates JDK methods such as file, stream, encryption and decryption, transcoding, regular, thread, XML, etc., to form various Util tool classes, and provides the following components:
Module | Introduction |
---|---|
hutool-aop | JDK dynamic proxy package, providing non-IOC aspect support |
hutool-bloomFilter | Bloom filter, provide some Bloom filters of Hash algorithm |
hutool-cache | Simple cache implementation |
hutool-core | Core, including Bean operation, date, various Util, etc. |
hutool-cron | Timing task module, providing timing tasks like Crontab expressions |
hutool-crypto | Encryption and decryption module, providing symmetric, asymmetric and digest algorithm packaging |
hutool-db | Data manipulation after JDBC encapsulation, based on the idea of ActiveRecord |
hutool-dfa | Multi-keyword search based on DFA model |
hutool extra | Extension module, package for third parties (template engine, email, Servlet, QR code, Emoji, FTP, word segmentation, etc.) |
hutool-http | Http client package based on HttpUrlConnection |
hutool-log | Log facade realized by automatic identification log |
hutool-script | Script execution package, such as Javascript |
hutool-setting | More powerful Setting configuration file and Properties package |
hutool-system | System parameter call package (JVM information, etc.) |
hutool-json | JSON implementation |
hutool-captcha | Image verification code implementation |
hutool-poi | Packaging for Excel and Word in POI |
hutool-socket | Java-based NIO and AIO socket packaging |
Each module can be introduced separately according to requirements, or hutool-all
all modules can be introduced by way of introduction.