Class CompositeAction
java.lang.Object
cloud.opencode.base.rules.action.CompositeAction
- All Implemented Interfaces:
Action
Composite Action - Executes Multiple Actions in Sequence
组合动作 - 按顺序执行多个动作
Combines multiple actions into a single action that executes them sequentially.
将多个动作组合成一个按顺序执行的单一动作。
Features | 主要功能:
- Sequential action execution - 顺序动作执行
- Error aggregation with suppressed exceptions - 使用抑制异常的错误聚合
- Factory method support - 工厂方法支持
Usage Examples | 使用示例:
Action combined = new CompositeAction(List.of(
ctx -> ctx.setResult("step1", "done"),
ctx -> ctx.setResult("step2", "done")
));
Security | 安全性:
- Thread-safe: No (not synchronized) - 线程安全: 否(未同步)
- Null-safe: No (actions must not be null) - 空值安全: 否(动作不能为null)
- Since:
- JDK 25, opencode-base-rules V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(RuleContext context) Executes this action with the given context 使用给定上下文执行此动作Gets the actions 获取动作列表static CompositeActionCreates a composite action from multiple actions 从多个动作创建组合动作
-
Constructor Details
-
CompositeAction
-
-
Method Details
-
execute
Description copied from interface:ActionExecutes this action with the given context 使用给定上下文执行此动作 -
getActions
-
of
Creates a composite action from multiple actions 从多个动作创建组合动作- Parameters:
actions- the actions | 动作- Returns:
- the composite action | 组合动作
-