Record Class Comment

java.lang.Object
java.lang.Record
cloud.opencode.base.flow.model.Comment
Record Components:
taskId - related task id — 任务 ID
operatorId - operator user id — 操作人
text - comment text — 意见正文
createdAt - creation timestamp — 创建时间

public record Comment(String taskId, String operatorId, String text, Instant createdAt) extends Record
Immutable comment attached to a task action. 附在任务动作上的不可变意见。

Length is capped at MAX_TEXT_LENGTH characters; over-length text is rejected with FlowErrorCode.INPUT_INVALID_TEXT.

文本长度上限为 MAX_TEXT_LENGTH;超长抛 IllegalActionException (FlowErrorCode.INPUT_INVALID_TEXT)。

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

    • MAX_TEXT_LENGTH

      public static final int MAX_TEXT_LENGTH
      Hard upper bound on text length. text 长度硬上限。
      See Also:
  • Constructor Details

  • 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.
    • taskId

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

      public String operatorId()
      Returns the value of the operatorId record component.
      Returns:
      the value of the operatorId record component
    • text

      public String text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • createdAt

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