Package io.a2a.spec
Record Class TaskStatusUpdateEvent
java.lang.Object
java.lang.Record
io.a2a.spec.TaskStatusUpdateEvent
- Record Components:
taskId- the task identifier (required)status- the task status (required)contextId- the context identifier (required)isFinal- whether this is a final statusmetadata- additional metadata (optional)
- All Implemented Interfaces:
Event,EventKind,StreamingEventKind,UpdateEvent
public record TaskStatusUpdateEvent(String taskId, TaskStatus status, String contextId, boolean isFinal, @Nullable Map<String,Object> metadata)
extends Record
implements EventKind, StreamingEventKind, UpdateEvent
An event sent by the agent to notify the client of a change in a task's status.
This is typically used in streaming or subscription models.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructingTaskStatusUpdateEventinstances. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe identifier when used in streaming responses -
Constructor Summary
ConstructorsConstructorDescriptionTaskStatusUpdateEvent(String taskId, TaskStatus status, String contextId, boolean isFinal, @Nullable Map<String, Object> metadata) Compact constructor with validation. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a new Builderbuilder(TaskStatusUpdateEvent event) Create a new Builder initialized with values from an existing TaskStatusUpdateEvent.Returns the value of thecontextIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisFinal()Returns the value of theisFinalrecord component.booleanIndicates if the task is fianl or waiting for some inputs from the client.kind()Returns the type identifier for this event.metadata()Returns the value of themetadatarecord component.status()Returns the value of thestatusrecord component.taskId()Returns the value of thetaskIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
STREAMING_EVENT_ID
The identifier when used in streaming responses- See Also:
-
-
Constructor Details
-
TaskStatusUpdateEvent
public TaskStatusUpdateEvent(String taskId, TaskStatus status, String contextId, boolean isFinal, @Nullable Map<String, Object> metadata) Compact constructor with validation.- Parameters:
taskId- the task identifier (required)status- the task status (required)contextId- the context identifier (required)isFinal- whether this is a final statusmetadata- additional metadata (optional)- Throws:
IllegalArgumentException- if taskId, status, or contextId is null
-
-
Method Details
-
kind
Description copied from interface:EventKindReturns the type identifier for this event.This method provides programmatic type discrimination for routing, logging, and debugging. NOTE: This value is NOT serialized to JSON in protocol v1.0+.
- Specified by:
kindin interfaceEventKind- Specified by:
kindin interfaceStreamingEventKind- Returns:
- the event kind string (e.g., "task", "message")
-
isFinalOrInterrupted
public boolean isFinalOrInterrupted()Indicates if the task is fianl or waiting for some inputs from the client.- Returns:
- true if the task is fianl or waiting for some inputs from the client - false otherwise.
-
builder
Create a new Builder- Returns:
- the builder
-
builder
Create a new Builder initialized with values from an existing TaskStatusUpdateEvent.- Parameters:
event- the TaskStatusUpdateEvent to copy values from- Returns:
- the builder
-
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
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
contextId
Returns the value of thecontextIdrecord component.- Returns:
- the value of the
contextIdrecord component
-
isFinal
@SerializedName("final") public boolean isFinal()Returns the value of theisFinalrecord component.- Returns:
- the value of the
isFinalrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-