AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:175–292

构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.scheduler.config 包。核心成员包括 cron、fixedRate、fixedDelay、initialDelay、zoneId、build。

Builder for creating ScheduleConfig instances.

方法摘要Method Summary

方法Method说明Description
public Builder cron(String expression)
设置该配置项。
Configure a cron-based schedule.
public Builder fixedRate(Long rate)
设置该配置项。
Configure a fixed-rate schedule.
public Builder fixedDelay(Long delay)
设置该配置项。
Configure a fixed-delay schedule.
public Builder initialDelay(Long delay)
设置该配置项。
Set the initial delay before the first execution.
public Builder zoneId(String zoneIdStr)
设置可用区标识。
Set the time zone ID for cron expression evaluation.
public ScheduleConfig build()
构建ScheduleConfig 实例。
Build the ScheduleConfig instance.

方法详情Method Detail

cron

public Builder cron(String expression)

设置该配置项。

Configure a cron-based schedule.

参数Parameters
名称Name类型Type说明Description
expressionStringexpression(类型 `String`)。The cron expression
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:210–214

fixedRate

public Builder fixedRate(Long rate)

设置该配置项。

Configure a fixed-rate schedule.

参数Parameters
名称Name类型Type说明Description
rateLong速率(类型 `Long`)。The fixed rate duration between executions in milliseconds
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:229–233

fixedDelay

public Builder fixedDelay(Long delay)

设置该配置项。

Configure a fixed-delay schedule.

参数Parameters
名称Name类型Type说明Description
delayLong延迟(类型 `Long`)。The fixed delay duration between completion and next execution in milliseconds
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:247–251

initialDelay

public Builder initialDelay(Long delay)

设置该配置项。

Set the initial delay before the first execution.

参数Parameters
名称Name类型Type说明Description
delayLong延迟(类型 `Long`)。The initial delay in milliseconds
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:262–265

zoneId

public Builder zoneId(String zoneIdStr)

设置可用区标识。

Set the time zone ID for cron expression evaluation.

参数Parameters
名称Name类型Type说明Description
zoneIdStrString可用区标识 Str(类型 `String`)。The time zone ID string (e.g., "Asia/Shanghai")
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:278–281

build

public ScheduleConfig build()

构建ScheduleConfig 实例。

Build the ScheduleConfig instance.

返回Returns ScheduleConfig
一种新的ScheduleConfig 实例。A new ScheduleConfig instance
抛出Throws
  • IllegalArgumentException 当if 配置是无效时抛出 `IllegalArgumentException`。if the configuration is invalid
源码Source io/agentscope/extensions/scheduler/config/ScheduleConfig.java:289–291
基于官方固定版本源码静态生成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.