Record Class SubagentTaskView
java.lang.Object
java.lang.Record
io.agentscope.spring.boot.admin.dto.SubagentTaskView
- Record Components:
taskId- backend-assigned task identifiersubagentId- the subagent type executing the taskstatus- one of theTaskStatusnamescreatedAt- task submission timelastCheckedAt- last status read timecompleted- convenience flagresultPreview- first 500 chars of the result whencompleted, otherwise nullerrorMessage- non-null when the task failed
public record SubagentTaskView(String taskId, String subagentId, String status, Instant createdAt, Instant lastCheckedAt, boolean completed, String resultPreview, String errorMessage)
extends Record
Wire view of a
BackgroundTask dispatched to a subagent. Distinct from
AgentTaskView, which is the in-AgentState TodoWrite-style record.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecompletedrecord component.Returns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorMessagerecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thelastCheckedAtrecord component.static SubagentTaskViewof(io.agentscope.harness.agent.subagent.task.BackgroundTask t) Returns the value of theresultPreviewrecord component.status()Returns the value of thestatusrecord component.Returns the value of thesubagentIdrecord component.taskId()Returns the value of thetaskIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SubagentTaskView
public SubagentTaskView(String taskId, String subagentId, String status, Instant createdAt, Instant lastCheckedAt, boolean completed, String resultPreview, String errorMessage) Creates an instance of aSubagentTaskViewrecord class.- Parameters:
taskId- the value for thetaskIdrecord componentsubagentId- the value for thesubagentIdrecord componentstatus- the value for thestatusrecord componentcreatedAt- the value for thecreatedAtrecord componentlastCheckedAt- the value for thelastCheckedAtrecord componentcompleted- the value for thecompletedrecord componentresultPreview- the value for theresultPreviewrecord componenterrorMessage- the value for theerrorMessagerecord component
-
-
Method Details
-
of
-
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. -
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. -
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 '=='. -
taskId
Returns the value of thetaskIdrecord component.- Returns:
- the value of the
taskIdrecord component
-
subagentId
Returns the value of thesubagentIdrecord component.- Returns:
- the value of the
subagentIdrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
lastCheckedAt
Returns the value of thelastCheckedAtrecord component.- Returns:
- the value of the
lastCheckedAtrecord component
-
completed
public boolean completed()Returns the value of thecompletedrecord component.- Returns:
- the value of the
completedrecord component
-
resultPreview
Returns the value of theresultPreviewrecord component.- Returns:
- the value of the
resultPreviewrecord component
-
errorMessage
Returns the value of theerrorMessagerecord component.- Returns:
- the value of the
errorMessagerecord component
-