Record Class Message_v0_3

java.lang.Object
java.lang.Record
org.a2aproject.sdk.compat03.spec.Message_v0_3
All Implemented Interfaces:
Event_v0_3, EventKind_v0_3, StreamingEventKind_v0_3

public record Message_v0_3(Message_v0_3.Role role, List<Part_v0_3<?>> parts, @Nullable String messageId, @Nullable String contextId, @Nullable String taskId, @Nullable List<String> referenceTaskIds, @Nullable Map<String,Object> metadata, @Nullable List<String> extensions, String kind) extends Record implements EventKind_v0_3, StreamingEventKind_v0_3
Represents a single message in the conversation between a user and an agent.
  • Field Details

  • Constructor Details

    • Message_v0_3

      public Message_v0_3(Message_v0_3.Role role, List<Part_v0_3<?>> parts, @Nullable String messageId, @Nullable String contextId, @Nullable String taskId, @Nullable List<String> referenceTaskIds, @Nullable Map<String,Object> metadata, @Nullable List<String> extensions, String kind)
      Creates an instance of a Message_v0_3 record class.
      Parameters:
      role - the value for the role record component
      parts - the value for the parts record component
      messageId - the value for the messageId record component
      contextId - the value for the contextId record component
      taskId - the value for the taskId record component
      referenceTaskIds - the value for the referenceTaskIds record component
      metadata - the value for the metadata record component
      extensions - the value for the extensions record component
      kind - the value for the kind record component
    • Message_v0_3

      public Message_v0_3(Message_v0_3.Role role, List<Part_v0_3<?>> parts, @Nullable String messageId, @Nullable String contextId, @Nullable String taskId, @Nullable List<String> referenceTaskIds, @Nullable Map<String,Object> metadata, @Nullable List<String> extensions)
  • 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.
    • role

      public Message_v0_3.Role role()
      Returns the value of the role record component.
      Returns:
      the value of the role record component
    • parts

      public List<Part_v0_3<?>> parts()
      Returns the value of the parts record component.
      Returns:
      the value of the parts record component
    • messageId

      public @Nullable String messageId()
      Returns the value of the messageId record component.
      Returns:
      the value of the messageId record component
    • contextId

      public @Nullable String contextId()
      Returns the value of the contextId record component.
      Returns:
      the value of the contextId record component
    • taskId

      public @Nullable String taskId()
      Returns the value of the taskId record component.
      Returns:
      the value of the taskId record component
    • referenceTaskIds

      public @Nullable List<String> referenceTaskIds()
      Returns the value of the referenceTaskIds record component.
      Returns:
      the value of the referenceTaskIds record component
    • metadata

      public @Nullable Map<String,Object> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component
    • extensions

      public @Nullable List<String> extensions()
      Returns the value of the extensions record component.
      Returns:
      the value of the extensions record component
    • kind

      public String kind()
      Returns the value of the kind record component.
      Specified by:
      kind in interface EventKind_v0_3
      Specified by:
      kind in interface StreamingEventKind_v0_3
      Returns:
      the value of the kind record component