Record Class Step

java.lang.Object
java.lang.Record
cloud.opencode.base.flow.model.Step
Record Components:
id - unique within the flow — 流程内唯一 id
type - 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):

字段约束: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 Details

    • Step

      public Step(String id, StepType type, Strategy strategy, String mode, List<Assignee> assignees)
      Compact constructor that validates and immutably copies assignees. 紧凑构造器:校验入参并对 assignees 进行不可变拷贝。
      Throws:
      NullPointerException - when id/type is null
      DslParseException - when role/strategy/mode/assignees mismatch the node type
      Since:
      JDK 25, opencode-base-flow V1.0.5
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • type

      public StepType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • strategy

      public Strategy strategy()
      Returns the value of the strategy record component.
      Returns:
      the value of the strategy record component
    • mode

      public String mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • assignees

      public List<Assignee> assignees()
      Returns the value of the assignees record component.
      Returns:
      the value of the assignees record component