Class MysqlSkillRepository.Builder

java.lang.Object
io.agentscope.core.skill.repository.mysql.MysqlSkillRepository.Builder
Enclosing class:
MysqlSkillRepository

public static class MysqlSkillRepository.Builder extends Object
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 Details

    • databaseName

      public MysqlSkillRepository.Builder databaseName(String databaseName)
      Set the database name for storing skills.
      Parameters:
      databaseName - the database name (default: "agentscope")
      Returns:
      this builder for method chaining
    • skillsTableName

      public MysqlSkillRepository.Builder skillsTableName(String skillsTableName)
      Set the skills table name.
      Parameters:
      skillsTableName - the skills table name (default: "agentscope_skills")
      Returns:
      this builder for method chaining
    • resourcesTableName

      public MysqlSkillRepository.Builder resourcesTableName(String resourcesTableName)
      Set the resources table name.
      Parameters:
      resourcesTableName - the resources table name (default: "agentscope_skill_resources")
      Returns:
      this builder for method chaining
    • createIfNotExist

      public MysqlSkillRepository.Builder createIfNotExist(boolean createIfNotExist)
      Set whether to create database and tables if they don't exist.
      Parameters:
      createIfNotExist - true to auto-create, false to require existing (default: true)
      Returns:
      this builder for method chaining
    • writeable

      public MysqlSkillRepository.Builder writeable(boolean writeable)
      Set whether the repository supports write operations.
      Parameters:
      writeable - true to enable write operations, false for read-only (default: true)
      Returns:
      this builder for method chaining
    • build

      public MysqlSkillRepository build()
      Build the MysqlSkillRepository instance.
      Returns:
      a new MysqlSkillRepository instance
      Throws:
      IllegalArgumentException - if identifiers are invalid
      IllegalStateException - if createIfNotExist is false and database/tables do not exist