Record Class Comment
java.lang.Object
java.lang.Record
cloud.opencode.base.flow.model.Comment
- Record Components:
taskId- related task id — 任务 IDoperatorId- 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intHard upper bound ontextlength. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theoperatorIdrecord component.taskId()Returns the value of thetaskIdrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
MAX_TEXT_LENGTH
public static final int MAX_TEXT_LENGTHHard upper bound ontextlength.text长度硬上限。- See Also:
-
-
Constructor Details
-
Comment
Compact constructor; validates text length. 紧凑构造器:校验文本长度。- Throws:
NullPointerException- whentextis nullIllegalActionException- whentext.length() >MAX_TEXT_LENGTH- 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). -
taskId
-
operatorId
Returns the value of theoperatorIdrecord component.- Returns:
- the value of the
operatorIdrecord component
-
text
-
createdAt
-