Record Class VoteRecord

java.lang.Object
java.lang.Record
cloud.opencode.base.flow.model.VoteRecord
Record Components:
id - vote record id — 记录 ID
taskId - related task id — 关联任务 ID
voterId - voter user id — 投票人
opinion - vote opinion (VoteOpinion.AGREE / VoteOpinion.DISAGREE) — 投票意见
votedAt - vote timestamp — 投票时间

public record VoteRecord(String id, String taskId, String voterId, VoteOpinion opinion, Instant votedAt) extends Record
Single vote cast at a StepType.VOTE step (mirrors flow_vote_record row). 投票节点(StepType.VOTE)单次投票记录(对应 flow_vote_record 表行)。

Append-only: votes are written once and never updated; the engine relies on this immutability to compute tally idempotently.

仅追加:投票记录写入后不再变更,引擎据此幂等地统计票数。

Since:
JDK 25, opencode-base-flow V1.0.5
Author:
Leon Soo
  • Constructor Details

    • VoteRecord

      public VoteRecord(String id, String taskId, String voterId, VoteOpinion opinion, Instant votedAt)
      Compact constructor; validates required fields. 紧凑构造器:校验必填字段。
      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
    • taskId

      public String taskId()
      Returns the value of the taskId record component.
      Returns:
      the value of the taskId record component
    • voterId

      public String voterId()
      Returns the value of the voterId record component.
      Returns:
      the value of the voterId record component
    • opinion

      public VoteOpinion opinion()
      Returns the value of the opinion record component.
      Returns:
      the value of the opinion record component
    • votedAt

      public Instant votedAt()
      Returns the value of the votedAt record component.
      Returns:
      the value of the votedAt record component