Class Message.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Message.Builder>
org.a2aproject.sdk.grpc.Message.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable, MessageOrBuilder
Enclosing class:
Message

public static final class Message.Builder extends com.google.protobuf.GeneratedMessage.Builder<Message.Builder> implements MessageOrBuilder
 `Message` is one unit of communication between client and server. It can be
 associated with a context and/or a task. For server messages, `context_id` must
 be provided, and `task_id` only if a task was created. For client messages, both
 fields are optional, with the caveat that if both are provided, they have to
 match (the `context_id` has to be the one that is set on the task). If only
 `task_id` is provided, the server will infer `context_id` from it.
 
Protobuf type lf.a2a.v1.Message
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Message.Builder>
    • clear

      public Message.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<Message.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<Message.Builder>
    • getDefaultInstanceForType

      public Message getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public Message build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Message buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public Message.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Message.Builder>
    • mergeFrom

      public Message.Builder mergeFrom(Message other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<Message.Builder>
    • mergeFrom

      public Message.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Message.Builder>
      Throws:
      IOException
    • getMessageId

      public String getMessageId()
       The unique identifier (e.g. UUID) of the message. This is created by the message creator.
       
      string message_id = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getMessageId in interface MessageOrBuilder
      Returns:
      The messageId.
    • getMessageIdBytes

      public com.google.protobuf.ByteString getMessageIdBytes()
       The unique identifier (e.g. UUID) of the message. This is created by the message creator.
       
      string message_id = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getMessageIdBytes in interface MessageOrBuilder
      Returns:
      The bytes for messageId.
    • setMessageId

      public Message.Builder setMessageId(String value)
       The unique identifier (e.g. UUID) of the message. This is created by the message creator.
       
      string message_id = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The messageId to set.
      Returns:
      This builder for chaining.
    • clearMessageId

      public Message.Builder clearMessageId()
       The unique identifier (e.g. UUID) of the message. This is created by the message creator.
       
      string message_id = 1 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setMessageIdBytes

      public Message.Builder setMessageIdBytes(com.google.protobuf.ByteString value)
       The unique identifier (e.g. UUID) of the message. This is created by the message creator.
       
      string message_id = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for messageId to set.
      Returns:
      This builder for chaining.
    • getContextId

      public String getContextId()
       Optional. The context id of the message. If set, the message will be associated with the given context.
       
      string context_id = 2;
      Specified by:
      getContextId in interface MessageOrBuilder
      Returns:
      The contextId.
    • getContextIdBytes

      public com.google.protobuf.ByteString getContextIdBytes()
       Optional. The context id of the message. If set, the message will be associated with the given context.
       
      string context_id = 2;
      Specified by:
      getContextIdBytes in interface MessageOrBuilder
      Returns:
      The bytes for contextId.
    • setContextId

      public Message.Builder setContextId(String value)
       Optional. The context id of the message. If set, the message will be associated with the given context.
       
      string context_id = 2;
      Parameters:
      value - The contextId to set.
      Returns:
      This builder for chaining.
    • clearContextId

      public Message.Builder clearContextId()
       Optional. The context id of the message. If set, the message will be associated with the given context.
       
      string context_id = 2;
      Returns:
      This builder for chaining.
    • setContextIdBytes

      public Message.Builder setContextIdBytes(com.google.protobuf.ByteString value)
       Optional. The context id of the message. If set, the message will be associated with the given context.
       
      string context_id = 2;
      Parameters:
      value - The bytes for contextId to set.
      Returns:
      This builder for chaining.
    • getTaskId

      public String getTaskId()
       Optional. The task id of the message. If set, the message will be associated with the given task.
       
      string task_id = 3;
      Specified by:
      getTaskId in interface MessageOrBuilder
      Returns:
      The taskId.
    • getTaskIdBytes

      public com.google.protobuf.ByteString getTaskIdBytes()
       Optional. The task id of the message. If set, the message will be associated with the given task.
       
      string task_id = 3;
      Specified by:
      getTaskIdBytes in interface MessageOrBuilder
      Returns:
      The bytes for taskId.
    • setTaskId

      public Message.Builder setTaskId(String value)
       Optional. The task id of the message. If set, the message will be associated with the given task.
       
      string task_id = 3;
      Parameters:
      value - The taskId to set.
      Returns:
      This builder for chaining.
    • clearTaskId

      public Message.Builder clearTaskId()
       Optional. The task id of the message. If set, the message will be associated with the given task.
       
      string task_id = 3;
      Returns:
      This builder for chaining.
    • setTaskIdBytes

      public Message.Builder setTaskIdBytes(com.google.protobuf.ByteString value)
       Optional. The task id of the message. If set, the message will be associated with the given task.
       
      string task_id = 3;
      Parameters:
      value - The bytes for taskId to set.
      Returns:
      This builder for chaining.
    • getRoleValue

      public int getRoleValue()
       Identifies the sender of the message.
       
      .lf.a2a.v1.Role role = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getRoleValue in interface MessageOrBuilder
      Returns:
      The enum numeric value on the wire for role.
    • setRoleValue

      public Message.Builder setRoleValue(int value)
       Identifies the sender of the message.
       
      .lf.a2a.v1.Role role = 4 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The enum numeric value on the wire for role to set.
      Returns:
      This builder for chaining.
    • getRole

      public Role getRole()
       Identifies the sender of the message.
       
      .lf.a2a.v1.Role role = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getRole in interface MessageOrBuilder
      Returns:
      The role.
    • setRole

      public Message.Builder setRole(Role value)
       Identifies the sender of the message.
       
      .lf.a2a.v1.Role role = 4 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The role to set.
      Returns:
      This builder for chaining.
    • clearRole

      public Message.Builder clearRole()
       Identifies the sender of the message.
       
      .lf.a2a.v1.Role role = 4 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • getPartsList

      public List<Part> getPartsList()
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getPartsList in interface MessageOrBuilder
    • getPartsCount

      public int getPartsCount()
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getPartsCount in interface MessageOrBuilder
    • getParts

      public Part getParts(int index)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getParts in interface MessageOrBuilder
    • setParts

      public Message.Builder setParts(int index, Part value)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • setParts

      public Message.Builder setParts(int index, Part.Builder builderForValue)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • addParts

      public Message.Builder addParts(Part value)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • addParts

      public Message.Builder addParts(int index, Part value)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • addParts

      public Message.Builder addParts(Part.Builder builderForValue)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • addParts

      public Message.Builder addParts(int index, Part.Builder builderForValue)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • addAllParts

      public Message.Builder addAllParts(Iterable<? extends Part> values)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • clearParts

      public Message.Builder clearParts()
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • removeParts

      public Message.Builder removeParts(int index)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • getPartsBuilder

      public Part.Builder getPartsBuilder(int index)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • getPartsOrBuilder

      public PartOrBuilder getPartsOrBuilder(int index)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getPartsOrBuilder in interface MessageOrBuilder
    • getPartsOrBuilderList

      public List<? extends PartOrBuilder> getPartsOrBuilderList()
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getPartsOrBuilderList in interface MessageOrBuilder
    • addPartsBuilder

      public Part.Builder addPartsBuilder()
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • addPartsBuilder

      public Part.Builder addPartsBuilder(int index)
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • getPartsBuilderList

      public List<Part.Builder> getPartsBuilderList()
       Parts is the container of the message content.
       
      repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];
    • hasMetadata

      public boolean hasMetadata()
       Optional. Any metadata to provide along with the message.
       
      .google.protobuf.Struct metadata = 6;
      Specified by:
      hasMetadata in interface MessageOrBuilder
      Returns:
      Whether the metadata field is set.
    • getMetadata

      public com.google.protobuf.Struct getMetadata()
       Optional. Any metadata to provide along with the message.
       
      .google.protobuf.Struct metadata = 6;
      Specified by:
      getMetadata in interface MessageOrBuilder
      Returns:
      The metadata.
    • setMetadata

      public Message.Builder setMetadata(com.google.protobuf.Struct value)
       Optional. Any metadata to provide along with the message.
       
      .google.protobuf.Struct metadata = 6;
    • setMetadata

      public Message.Builder setMetadata(com.google.protobuf.Struct.Builder builderForValue)
       Optional. Any metadata to provide along with the message.
       
      .google.protobuf.Struct metadata = 6;
    • mergeMetadata

      public Message.Builder mergeMetadata(com.google.protobuf.Struct value)
       Optional. Any metadata to provide along with the message.
       
      .google.protobuf.Struct metadata = 6;
    • clearMetadata

      public Message.Builder clearMetadata()
       Optional. Any metadata to provide along with the message.
       
      .google.protobuf.Struct metadata = 6;
    • getMetadataBuilder

      public com.google.protobuf.Struct.Builder getMetadataBuilder()
       Optional. Any metadata to provide along with the message.
       
      .google.protobuf.Struct metadata = 6;
    • getMetadataOrBuilder

      public com.google.protobuf.StructOrBuilder getMetadataOrBuilder()
       Optional. Any metadata to provide along with the message.
       
      .google.protobuf.Struct metadata = 6;
      Specified by:
      getMetadataOrBuilder in interface MessageOrBuilder
    • getExtensionsList

      public com.google.protobuf.ProtocolStringList getExtensionsList()
       The URIs of extensions that are present or contributed to this Message.
       
      repeated string extensions = 7;
      Specified by:
      getExtensionsList in interface MessageOrBuilder
      Returns:
      A list containing the extensions.
    • getExtensionsCount

      public int getExtensionsCount()
       The URIs of extensions that are present or contributed to this Message.
       
      repeated string extensions = 7;
      Specified by:
      getExtensionsCount in interface MessageOrBuilder
      Returns:
      The count of extensions.
    • getExtensions

      public String getExtensions(int index)
       The URIs of extensions that are present or contributed to this Message.
       
      repeated string extensions = 7;
      Specified by:
      getExtensions in interface MessageOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The extensions at the given index.
    • getExtensionsBytes

      public com.google.protobuf.ByteString getExtensionsBytes(int index)
       The URIs of extensions that are present or contributed to this Message.
       
      repeated string extensions = 7;
      Specified by:
      getExtensionsBytes in interface MessageOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the extensions at the given index.
    • setExtensions

      public Message.Builder setExtensions(int index, String value)
       The URIs of extensions that are present or contributed to this Message.
       
      repeated string extensions = 7;
      Parameters:
      index - The index to set the value at.
      value - The extensions to set.
      Returns:
      This builder for chaining.
    • addExtensions

      public Message.Builder addExtensions(String value)
       The URIs of extensions that are present or contributed to this Message.
       
      repeated string extensions = 7;
      Parameters:
      value - The extensions to add.
      Returns:
      This builder for chaining.
    • addAllExtensions

      public Message.Builder addAllExtensions(Iterable<String> values)
       The URIs of extensions that are present or contributed to this Message.
       
      repeated string extensions = 7;
      Parameters:
      values - The extensions to add.
      Returns:
      This builder for chaining.
    • clearExtensions

      public Message.Builder clearExtensions()
       The URIs of extensions that are present or contributed to this Message.
       
      repeated string extensions = 7;
      Returns:
      This builder for chaining.
    • addExtensionsBytes

      public Message.Builder addExtensionsBytes(com.google.protobuf.ByteString value)
       The URIs of extensions that are present or contributed to this Message.
       
      repeated string extensions = 7;
      Parameters:
      value - The bytes of the extensions to add.
      Returns:
      This builder for chaining.
    • getReferenceTaskIdsList

      public com.google.protobuf.ProtocolStringList getReferenceTaskIdsList()
       A list of task IDs that this message references for additional context.
       
      repeated string reference_task_ids = 8;
      Specified by:
      getReferenceTaskIdsList in interface MessageOrBuilder
      Returns:
      A list containing the referenceTaskIds.
    • getReferenceTaskIdsCount

      public int getReferenceTaskIdsCount()
       A list of task IDs that this message references for additional context.
       
      repeated string reference_task_ids = 8;
      Specified by:
      getReferenceTaskIdsCount in interface MessageOrBuilder
      Returns:
      The count of referenceTaskIds.
    • getReferenceTaskIds

      public String getReferenceTaskIds(int index)
       A list of task IDs that this message references for additional context.
       
      repeated string reference_task_ids = 8;
      Specified by:
      getReferenceTaskIds in interface MessageOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The referenceTaskIds at the given index.
    • getReferenceTaskIdsBytes

      public com.google.protobuf.ByteString getReferenceTaskIdsBytes(int index)
       A list of task IDs that this message references for additional context.
       
      repeated string reference_task_ids = 8;
      Specified by:
      getReferenceTaskIdsBytes in interface MessageOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the referenceTaskIds at the given index.
    • setReferenceTaskIds

      public Message.Builder setReferenceTaskIds(int index, String value)
       A list of task IDs that this message references for additional context.
       
      repeated string reference_task_ids = 8;
      Parameters:
      index - The index to set the value at.
      value - The referenceTaskIds to set.
      Returns:
      This builder for chaining.
    • addReferenceTaskIds

      public Message.Builder addReferenceTaskIds(String value)
       A list of task IDs that this message references for additional context.
       
      repeated string reference_task_ids = 8;
      Parameters:
      value - The referenceTaskIds to add.
      Returns:
      This builder for chaining.
    • addAllReferenceTaskIds

      public Message.Builder addAllReferenceTaskIds(Iterable<String> values)
       A list of task IDs that this message references for additional context.
       
      repeated string reference_task_ids = 8;
      Parameters:
      values - The referenceTaskIds to add.
      Returns:
      This builder for chaining.
    • clearReferenceTaskIds

      public Message.Builder clearReferenceTaskIds()
       A list of task IDs that this message references for additional context.
       
      repeated string reference_task_ids = 8;
      Returns:
      This builder for chaining.
    • addReferenceTaskIdsBytes

      public Message.Builder addReferenceTaskIdsBytes(com.google.protobuf.ByteString value)
       A list of task IDs that this message references for additional context.
       
      repeated string reference_task_ids = 8;
      Parameters:
      value - The bytes of the referenceTaskIds to add.
      Returns:
      This builder for chaining.