AS AgentScopeAPI 手册 / API Reference

Builder

public static final class Builder
源码Source io/agentscope/extensions/mysql/store/JdbcStore.java:355–417

JdbcStore的构建器。位于 io.agentscope.extensions.mysql.store 包。核心成员包括 dialect、objectMapper、tableName、initializeSchema、build。

Builder for JdbcStore.

方法摘要Method Summary

方法Method说明Description
public Builder dialect(JdbcStoreDialect dialect)
设置该配置项。
Sets the dialect explicitly.
public Builder objectMapper(ObjectMapper objectMapper)
设置该配置项。
Sets a custom Jackson `ObjectMapper` for value serialisation.
public Builder tableName(String tableName)
设置该配置项。
Overrides the table name.
public Builder initializeSchema(boolean initializeSchema)
设置初始化模式。
When `true`, runs the dialect's `CREATE TABLE IF NOT EXISTS` during construction.
public JdbcStore build()
构建`JdbcStore`。
Builds the `JdbcStore`.

方法详情Method Detail

dialect

public Builder dialect(JdbcStoreDialect dialect)

设置该配置项。

Sets the dialect explicitly.

参数Parameters
名称Name类型Type说明Description
dialectJdbcStoreDialectdialect(类型 `JdbcStoreDialect`)。The dialect.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/mysql/store/JdbcStore.java:371–374

objectMapper

public Builder objectMapper(ObjectMapper objectMapper)

设置该配置项。

Sets a custom Jackson ObjectMapper for value serialisation.

参数Parameters
名称Name类型Type说明Description
objectMapperObjectMapper对象 Mapper(类型 `ObjectMapper`)。The object mapper.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/mysql/store/JdbcStore.java:377–380

tableName

public Builder tableName(String tableName)

设置该配置项。

Overrides the table name.

参数Parameters
名称Name类型Type说明Description
tableNameStringtable 名称(类型 `String`)。The table name.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/mysql/store/JdbcStore.java:387–396

initializeSchema

public Builder initializeSchema(boolean initializeSchema)

设置初始化模式。

When true, runs the dialect's CREATE TABLE IF NOT EXISTS during construction.

参数Parameters
名称Name类型Type说明Description
initializeSchemaboolean初始化模式(类型 `boolean`)。The initialize schema.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/mysql/store/JdbcStore.java:403–406

build

public JdbcStore build()

构建JdbcStore。

Builds the JdbcStore.

返回Returns JdbcStore
返回JdbcStore。Returns jdbc store.
源码Source io/agentscope/extensions/mysql/store/JdbcStore.java:409–416
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.