Builder
public static class Builder
源码Source
io/agentscope/core/skill/repository/mysql/MysqlSkillRepository.java:1210–1307构建器,用于构建并配置目标实例。位于 io.agentscope.core.skill.repository.mysql 包。核心成员包括 databaseName、skillsTableName、resourcesTableName、createIfNotExist、writeable、build。
Builder for creating MysqlSkillRepository instances with custom configuration.
This builder provides a fluent API for configuring all aspects of the repository, including database name, table names, and behavior options.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder databaseName(String databaseName) | 设置数据库名称。 Set the database name for storing skills. |
public Builder skillsTableName(String skillsTableName) | 设置该配置项。 Set the skills table name. |
public Builder resourcesTableName(String resourcesTableName) | 设置该配置项。 Set the resources table name. |
public Builder createIfNotExist(boolean createIfNotExist) | 创建 `createIfNotExist`。 Set whether to create database and tables if they don't exist. |
public Builder writeable(boolean writeable) | 设置该配置项。 Set whether the repository supports write operations. |
public MysqlSkillRepository build() | 构建MysqlSkillRepository 实例。 Build the MysqlSkillRepository instance. |
方法详情Method Detail
databaseName
public Builder databaseName(String databaseName)
设置数据库名称。
Set the database name for storing skills.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
databaseName | String | 数据库名称(类型 `String`)。the database name (default: "agentscope") |
Builder返回当前实例,以支持链式调用。this builder for method chaining
源码Source
io/agentscope/core/skill/repository/mysql/MysqlSkillRepository.java:1238–1241skillsTableName
public Builder skillsTableName(String skillsTableName)
设置该配置项。
Set the skills table name.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillsTableName | String | 技能 Table 名称(类型 `String`)。the skills table name (default: "agentscope_skills") |
Builder返回当前实例,以支持链式调用。this builder for method chaining
源码Source
io/agentscope/core/skill/repository/mysql/MysqlSkillRepository.java:1249–1252resourcesTableName
public Builder resourcesTableName(String resourcesTableName)
设置该配置项。
Set the resources table name.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
resourcesTableName | String | resources Table 名称(类型 `String`)。the resources table name (default: "agentscope_skill_resources") |
Builder返回当前实例,以支持链式调用。this builder for method chaining
源码Source
io/agentscope/core/skill/repository/mysql/MysqlSkillRepository.java:1261–1264createIfNotExist
public Builder createIfNotExist(boolean createIfNotExist)
创建 createIfNotExist。
Set whether to create database and tables if they don't exist.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
createIfNotExist | boolean | 创建 If 不 Exist(类型 `boolean`)。true to auto-create, false to require existing (default: true) |
Builder返回当前实例,以支持链式调用。this builder for method chaining
源码Source
io/agentscope/core/skill/repository/mysql/MysqlSkillRepository.java:1273–1276writeable
public Builder writeable(boolean writeable)
设置该配置项。
Set whether the repository supports write operations.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
writeable | boolean | writeable(类型 `boolean`)。true to enable write operations, false for read-only (default: true) |
Builder返回当前实例,以支持链式调用。this builder for method chaining
源码Source
io/agentscope/core/skill/repository/mysql/MysqlSkillRepository.java:1285–1288build
public MysqlSkillRepository build()
构建MysqlSkillRepository 实例。
Build the MysqlSkillRepository instance.
MysqlSkillRepository一种新的MysqlSkillRepository 实例。a new MysqlSkillRepository instance
IllegalArgumentException可能抛出 `IllegalArgumentException`。if identifiers are invalidIllegalStateException可能抛出 `IllegalStateException`。if createIfNotExist is false and database/tables do not exist
源码Source
io/agentscope/core/skill/repository/mysql/MysqlSkillRepository.java:1298–1306