Record Class Task
java.lang.Object
java.lang.Record
cloud.opencode.base.flow.model.Task
- Record Components:
id- task id — 任务 IDinstanceId- owning instance id — 所属实例 IDstepId- step id of this task — 节点 IDassigneeId- single assignee user id — 单个承接人status- task status — 任务状态outcome- decision outcome (nullwhileTaskStatus.PENDING) — 决策结果(TaskStatus.PENDING时为null)lockVersion- optimistic lock version — 乐观锁版本createdAt- creation timestamp — 创建时间finishedAt- finish timestamp (nullwhile pending) — 完成时间
public record Task(String id, String instanceId, String stepId, String assigneeId, TaskStatus status, TaskOutcome outcome, int lockVersion, Instant createdAt, Instant finishedAt)
extends Record
Current or historical task (mirrors
flow_task row).
当前 / 历史任务(对应 flow_task 表行)。- Since:
- JDK 25, opencode-base-flow V1.0.5
- Author:
- Leon Soo
-
Constructor Summary
ConstructorsConstructorDescriptionTask(String id, String instanceId, String stepId, String assigneeId, TaskStatus status, TaskOutcome outcome, int lockVersion, Instant createdAt, Instant finishedAt) Compact constructor; validates required fields. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theassigneeIdrecord component.Returns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefinishedAtrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theinstanceIdrecord component.intReturns the value of thelockVersionrecord component.outcome()Returns the value of theoutcomerecord component.status()Returns the value of thestatusrecord component.stepId()Returns the value of thestepIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Task
public Task(String id, String instanceId, String stepId, String assigneeId, TaskStatus status, TaskOutcome outcome, int lockVersion, Instant createdAt, Instant finishedAt) Compact constructor; validates required fields. 紧凑构造器:校验必填字段。- 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
instanceId
Returns the value of theinstanceIdrecord component.- Returns:
- the value of the
instanceIdrecord component
-
stepId
-
assigneeId
Returns the value of theassigneeIdrecord component.- Returns:
- the value of the
assigneeIdrecord component
-
status
-
outcome
-
lockVersion
public int lockVersion()Returns the value of thelockVersionrecord component.- Returns:
- the value of the
lockVersionrecord component
-
createdAt
-
finishedAt
Returns the value of thefinishedAtrecord component.- Returns:
- the value of the
finishedAtrecord component
-