Record Class Step
java.lang.Object
java.lang.Record
cloud.opencode.base.flow.model.Step
- Record Components:
id- unique within the flow — 流程内唯一 idtype- node type — 节点类型strategy- strategy enum (vote only) — 投票节点策略mode- approve mode string (approve only) — 同意节点模式assignees- participants (immutable copy) — 参与者列表(不可变副本)
public record Step(String id, StepType type, Strategy strategy, String mode, List<Assignee> assignees)
extends Record
Step (node) definition inside a
FlowDefinition.
流程定义中的节点定义。
Field semantics (v4 §4.2 / §4.3 / §4.4):
strategy: required forStepType.VOTE(ALL/ANY/MAJORITY/VETO); must benullforStepType.ENDmode: required forStepType.APPROVE, value must be"sequential"or"one_of_n"; must benullforStepType.ENDassignees: required forStepType.APPROVE/StepType.VOTE; must be empty forStepType.END
字段约束:vote 节点必须给 strategy(ALL/ANY/MAJORITY/VETO);
approve 节点必须给 mode("sequential" 或 "one_of_n");
end 节点 strategy/mode 应为 null 且 assignees 为空。
- Since:
- JDK 25, opencode-base-flow V1.0.5
- Author:
- Leon Soo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theassigneesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.mode()Returns the value of themoderecord component.strategy()Returns the value of thestrategyrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Step
Compact constructor that validates and immutably copiesassignees. 紧凑构造器:校验入参并对assignees进行不可变拷贝。- Throws:
NullPointerException- whenid/typeis nullDslParseException- when role/strategy/mode/assignees mismatch the node type- Since:
- JDK 25, opencode-base-flow V1.0.5
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
-
type
-
strategy
-
mode
-
assignees
-