# chinabugotech/hutool architecture

> Architecture diagram of the GitHub repository chinabugotech/hutool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chinabugotech/hutool
- Repository: https://github.com/chinabugotech/hutool

## Overview

Hutool is a modular Java utility library: developers call focused APIs to perform common programming tasks, from collection and string operations to HTTP, database, cryptography, and AI work. The README describes the module catalog; the tree confirms the corresponding implementation areas. The AI module has a more specific flow: callers submit chat messages through the common service API, model implementations handle provider-specific chat, and shared request code sends HTTP calls. Most non-AI internals were not sampled, so their documented capabilities are shown without inferred call links.

Main entry points: [`hutool-ai/src/main/java/cn/hutool/ai/core/AIService.java`](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-ai/src/main/java/cn/hutool/ai/core/AIService.java) (AI Service API), [`hutool-ai/src/main/java/cn/hutool/ai/model`](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-ai/src/main/java/cn/hutool/ai/model) (Model Clients), [`hutool-ai/src/main/java/cn/hutool/ai/core/BaseAIService.java`](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-ai/src/main/java/cn/hutool/ai/core/BaseAIService.java) (Shared HTTP Requests), [`hutool-core/src/main/java/cn/hutool/core`](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-core/src/main/java/cn/hutool/core) (Core APIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core Utilities"]
  node_coreapi["Core APIs"]
  node_collections["Collections<br/>[CollUtil.java]"]
  node_conversion["Conversion<br/>[Convert.java]"]
  node_files["File Utilities<br/>[FileUtil.java]"]
  node_assertions["Assertions<br/>[Assert.java]"]
  node_maps["Map Utilities<br/>[MapUtil.java]"]
  node_strings["String Utilities<br/>[StrUtil.java]"]
  node_text["Text Processing"]
  node_stringbuilder["String Builder<br/>[StrBuilder.java]"]
  node_arrays["Array Utilities<br/>[ArrayUtil.java]"]
  node_charsets["Charset Utilities<br/>[CharsetUtil.java]"]
  node_objects["Object Utilities<br/>[ObjectUtil.java]"]
end

subgraph group_integration["Application Integrations"]
  node_aop["AOP Proxies"]
  node_bloom["Bloom Filters"]
  node_cache["Caching"]
  node_captcha["CAPTCHA"]
  node_database["JDBC Data"]
  node_http["HTTP Client"]
  node_json["JSON"]
  node_jwt["JWT"]
  node_poi["Office Documents"]
  node_extra["Third-Party Adapters"]
end

subgraph group_services["Runtime Services"]
  node_cron["Task Scheduling<br/>[Scheduler.java]"]
  node_crypto["Cryptography<br/>[Mac.java]"]
  node_script["Script Execution"]
  node_settings["Configuration<br/>[Setting.java]"]
  node_socket["Socket I/O"]
  node_system["System Info"]
end

subgraph group_ai["AI Clients"]
  node_aiapi["AI Service API<br/>[AIService.java]"]
  node_messages["Chat Messages<br/>[Message.java]"]
  node_modelclients["Model Clients"]
  node_requestbase["Shared HTTP Requests<br/>[BaseAIService.java]"]
end

node_developer(("Java Developer"))
node_provider(("AI Provider"))

node_developer -->|"uses utilities"| node_coreapi
node_developer -->|"creates proxies"| node_aop
node_developer -->|"filters membership"| node_bloom
node_developer -->|"uses cache"| node_cache
node_developer -->|"generates CAPTCHA"| node_captcha
node_developer -->|"performs JDBC"| node_database
node_developer -->|"sends requests"| node_http
node_developer -->|"handles JSON"| node_json
node_developer -->|"uses tokens"| node_jwt
node_developer -->|"handles documents"| node_poi
node_developer -->|"uses adapters"| node_extra
node_developer -->|"schedules tasks"| node_cron
node_developer -->|"uses cryptography"| node_crypto
node_developer -->|"runs scripts"| node_script
node_developer -->|"loads settings"| node_settings
node_developer -->|"uses sockets"| node_socket
node_developer -->|"reads system info"| node_system
node_developer -->|"starts chat"| node_aiapi
node_aiapi -->|"accepts messages"| node_messages
node_modelclients -->|"implements API"| node_aiapi
node_requestbase -->|"sends HTTP requests"| node_provider

click node_coreapi "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-core/src/main/java/cn/hutool/core"
click node_collections "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java"
click node_conversion "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java"
click node_files "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java"
click node_assertions "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java"
click node_maps "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java"
click node_strings "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/util/StrUtil.java"
click node_text "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/text/CharSequenceUtil.java"
click node_stringbuilder "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/text/StrBuilder.java"
click node_arrays "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java"
click node_charsets "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/util/CharsetUtil.java"
click node_objects "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/util/ObjectUtil.java"
click node_aop "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-aop/src/main/java/cn/hutool/aop"
click node_bloom "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-bloomFilter/src/main/java/cn/hutool/bloomfilter"
click node_cache "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-cache/src/main/java/cn/hutool/cache"
click node_captcha "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-captcha/src/main/java/cn/hutool/captcha"
click node_database "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-db/src/main/java/cn/hutool/db"
click node_http "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-http/src/main/java/cn/hutool/http"
click node_json "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-json/src/main/java/cn/hutool/json"
click node_jwt "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-jwt/src/main/java/cn/hutool/jwt"
click node_poi "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-poi/src/main/java/cn/hutool/poi"
click node_extra "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-extra/src/main/java/cn/hutool/extra"
click node_cron "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-cron/src/main/java/cn/hutool/cron/Scheduler.java"
click node_crypto "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-crypto/src/main/java/cn/hutool/crypto/digest/mac/Mac.java"
click node_script "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-script/src/main/java/cn/hutool/script"
click node_settings "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-setting/src/main/java/cn/hutool/setting/Setting.java"
click node_socket "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-socket/src/main/java/cn/hutool/socket"
click node_system "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-system/src/main/java/cn/hutool/system"
click node_aiapi "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-ai/src/main/java/cn/hutool/ai/core/AIService.java"
click node_messages "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-ai/src/main/java/cn/hutool/ai/core/Message.java"
click node_modelclients "https://github.com/chinabugotech/hutool/tree/v5-master/hutool-ai/src/main/java/cn/hutool/ai/model"
click node_requestbase "https://github.com/chinabugotech/hutool/blob/v5-master/hutool-ai/src/main/java/cn/hutool/ai/core/BaseAIService.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_coreapi,node_collections,node_conversion,node_files,node_assertions,node_maps,node_strings,node_text,node_stringbuilder,node_arrays,node_charsets,node_objects toneBlue
class node_aop,node_bloom,node_cache,node_captcha,node_database,node_http,node_json,node_jwt,node_poi,node_extra toneAmber
class node_cron,node_crypto,node_script,node_settings,node_socket,node_system toneMint
class node_aiapi,node_messages,node_modelclients,node_requestbase toneRose
class node_developer,node_provider toneIndigo
```

## Components

### Core Utilities

- [Core APIs](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-core/src/main/java/cn/hutool/core): `hutool-core/src/main/java/cn/hutool/core`
- [Collections](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java): `hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java`
- [Conversion](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java): `hutool-core/src/main/java/cn/hutool/core/convert/Convert.java`
- [File Utilities](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java): `hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java`
- [Assertions](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java): `hutool-core/src/main/java/cn/hutool/core/lang/Assert.java`
- [Map Utilities](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java): `hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java`
- [String Utilities](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/util/StrUtil.java): `hutool-core/src/main/java/cn/hutool/core/util/StrUtil.java`
- [Text Processing](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/text/CharSequenceUtil.java): `hutool-core/src/main/java/cn/hutool/core/text/CharSequenceUtil.java`
- [String Builder](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/text/StrBuilder.java): `hutool-core/src/main/java/cn/hutool/core/text/StrBuilder.java`
- [Array Utilities](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java): `hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java`
- [Charset Utilities](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/util/CharsetUtil.java): `hutool-core/src/main/java/cn/hutool/core/util/CharsetUtil.java`
- [Object Utilities](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-core/src/main/java/cn/hutool/core/util/ObjectUtil.java): `hutool-core/src/main/java/cn/hutool/core/util/ObjectUtil.java`

### Application Integrations

- [AOP Proxies](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-aop/src/main/java/cn/hutool/aop): `hutool-aop/src/main/java/cn/hutool/aop`
- [Bloom Filters](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-bloomFilter/src/main/java/cn/hutool/bloomfilter): `hutool-bloomFilter/src/main/java/cn/hutool/bloomfilter`
- [Caching](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-cache/src/main/java/cn/hutool/cache): `hutool-cache/src/main/java/cn/hutool/cache`
- [CAPTCHA](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-captcha/src/main/java/cn/hutool/captcha): `hutool-captcha/src/main/java/cn/hutool/captcha`
- [JDBC Data](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-db/src/main/java/cn/hutool/db): `hutool-db/src/main/java/cn/hutool/db`
- [HTTP Client](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-http/src/main/java/cn/hutool/http): `hutool-http/src/main/java/cn/hutool/http`
- [JSON](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-json/src/main/java/cn/hutool/json): `hutool-json/src/main/java/cn/hutool/json`
- [JWT](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-jwt/src/main/java/cn/hutool/jwt): `hutool-jwt/src/main/java/cn/hutool/jwt`
- [Office Documents](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-poi/src/main/java/cn/hutool/poi): `hutool-poi/src/main/java/cn/hutool/poi`
- [Third-Party Adapters](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-extra/src/main/java/cn/hutool/extra): `hutool-extra/src/main/java/cn/hutool/extra`

### Runtime Services

- [Task Scheduling](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-cron/src/main/java/cn/hutool/cron/Scheduler.java): `hutool-cron/src/main/java/cn/hutool/cron/Scheduler.java`
- [Cryptography](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-crypto/src/main/java/cn/hutool/crypto/digest/mac/Mac.java): `hutool-crypto/src/main/java/cn/hutool/crypto/digest/mac/Mac.java`
- [Script Execution](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-script/src/main/java/cn/hutool/script): `hutool-script/src/main/java/cn/hutool/script`
- [Configuration](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-setting/src/main/java/cn/hutool/setting/Setting.java): `hutool-setting/src/main/java/cn/hutool/setting/Setting.java`
- [Socket I/O](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-socket/src/main/java/cn/hutool/socket): `hutool-socket/src/main/java/cn/hutool/socket`
- [System Info](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-system/src/main/java/cn/hutool/system): `hutool-system/src/main/java/cn/hutool/system`

### AI Clients

- [AI Service API](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-ai/src/main/java/cn/hutool/ai/core/AIService.java): `hutool-ai/src/main/java/cn/hutool/ai/core/AIService.java`
- [Chat Messages](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-ai/src/main/java/cn/hutool/ai/core/Message.java): `hutool-ai/src/main/java/cn/hutool/ai/core/Message.java`
- [Model Clients](https://github.com/chinabugotech/hutool/tree/v5-master/hutool-ai/src/main/java/cn/hutool/ai/model): `hutool-ai/src/main/java/cn/hutool/ai/model`
- [Shared HTTP Requests](https://github.com/chinabugotech/hutool/blob/v5-master/hutool-ai/src/main/java/cn/hutool/ai/core/BaseAIService.java): `hutool-ai/src/main/java/cn/hutool/ai/core/BaseAIService.java`

### Other components

- **Java Developer**
- **AI Provider**

## Connections

- Java Developer → Core APIs: uses utilities (evidence: `README.md`)
- Java Developer → AOP Proxies: creates proxies (evidence: `README.md`)
- Java Developer → Bloom Filters: filters membership (evidence: `README.md`)
- Java Developer → Caching: uses cache (evidence: `README.md`)
- Java Developer → CAPTCHA: generates CAPTCHA (evidence: `README.md`)
- Java Developer → JDBC Data: performs JDBC (evidence: `README.md`)
- Java Developer → HTTP Client: sends requests (evidence: `README.md`)
- Java Developer → JSON: handles JSON (evidence: `README.md`)
- Java Developer → JWT: uses tokens (evidence: `README.md`)
- Java Developer → Office Documents: handles documents (evidence: `README.md`)
- Java Developer → Third-Party Adapters: uses adapters (evidence: `README.md`)
- Java Developer → Task Scheduling: schedules tasks (evidence: `README.md`)
- Java Developer → Cryptography: uses cryptography (evidence: `README.md`)
- Java Developer → Script Execution: runs scripts (evidence: `README.md`)
- Java Developer → Configuration: loads settings (evidence: `README.md`)
- Java Developer → Socket I/O: uses sockets (evidence: `README.md`)
- Java Developer → System Info: reads system info (evidence: `README.md`)
- Java Developer → AI Service API: starts chat (evidence: `README.md`)
- AI Service API → Chat Messages: accepts messages (evidence: `hutool-ai/src/main/java/cn/hutool/ai/core/AIService.java`)
- Model Clients → AI Service API: implements API (evidence: `hutool-ai/src/main/java/cn/hutool/ai/model/openai/OpenaiService.java`)
- Shared HTTP Requests → AI Provider: sends HTTP requests (evidence: `hutool-ai/src/main/java/cn/hutool/ai/core/BaseAIService.java`)
