Package org.a2aproject.sdk.grpc
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 Summary
Modifier and TypeMethodDescriptionaddAllExtensions(Iterable<String> values) The URIs of extensions that are present or contributed to this Message.addAllParts(Iterable<? extends Part> values) Parts is the container of the message content.addAllReferenceTaskIds(Iterable<String> values) A list of task IDs that this message references for additional context.addExtensions(String value) The URIs of extensions that are present or contributed to this Message.addExtensionsBytes(com.google.protobuf.ByteString value) The URIs of extensions that are present or contributed to this Message.Parts is the container of the message content.addParts(int index, Part.Builder builderForValue) Parts is the container of the message content.Parts is the container of the message content.addParts(Part.Builder builderForValue) Parts is the container of the message content.Parts is the container of the message content.addPartsBuilder(int index) Parts is the container of the message content.addReferenceTaskIds(String value) A list of task IDs that this message references for additional context.addReferenceTaskIdsBytes(com.google.protobuf.ByteString value) A list of task IDs that this message references for additional context.build()clear()Optional.The URIs of extensions that are present or contributed to this Message.The unique identifier (e.g.Optional.Parts is the container of the message content.A list of task IDs that this message references for additional context.Identifies the sender of the message.Optional.Optional.com.google.protobuf.ByteStringOptional.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorgetExtensions(int index) The URIs of extensions that are present or contributed to this Message.com.google.protobuf.ByteStringgetExtensionsBytes(int index) The URIs of extensions that are present or contributed to this Message.intThe URIs of extensions that are present or contributed to this Message.com.google.protobuf.ProtocolStringListThe URIs of extensions that are present or contributed to this Message.The unique identifier (e.g.com.google.protobuf.ByteStringThe unique identifier (e.g.com.google.protobuf.StructOptional.com.google.protobuf.Struct.BuilderOptional.com.google.protobuf.StructOrBuilderOptional.getParts(int index) Parts is the container of the message content.getPartsBuilder(int index) Parts is the container of the message content.Parts is the container of the message content.intParts is the container of the message content.Parts is the container of the message content.getPartsOrBuilder(int index) Parts is the container of the message content.List<? extends PartOrBuilder>Parts is the container of the message content.getReferenceTaskIds(int index) A list of task IDs that this message references for additional context.com.google.protobuf.ByteStringgetReferenceTaskIdsBytes(int index) A list of task IDs that this message references for additional context.intA list of task IDs that this message references for additional context.com.google.protobuf.ProtocolStringListA list of task IDs that this message references for additional context.getRole()Identifies the sender of the message.intIdentifies the sender of the message.Optional.com.google.protobuf.ByteStringOptional.booleanOptional.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeMetadata(com.google.protobuf.Struct value) Optional.removeParts(int index) Parts is the container of the message content.setContextId(String value) Optional.setContextIdBytes(com.google.protobuf.ByteString value) Optional.setExtensions(int index, String value) The URIs of extensions that are present or contributed to this Message.setMessageId(String value) The unique identifier (e.g.setMessageIdBytes(com.google.protobuf.ByteString value) The unique identifier (e.g.setMetadata(com.google.protobuf.Struct value) Optional.setMetadata(com.google.protobuf.Struct.Builder builderForValue) Optional.Parts is the container of the message content.setParts(int index, Part.Builder builderForValue) Parts is the container of the message content.setReferenceTaskIds(int index, String value) A list of task IDs that this message references for additional context.Identifies the sender of the message.setRoleValue(int value) Identifies the sender of the message.Optional.setTaskIdBytes(com.google.protobuf.ByteString value) Optional.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<Message.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<Message.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<Message.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Message.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.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:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Message.Builder>- Throws:
IOException
-
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:
getMessageIdin interfaceMessageOrBuilder- 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:
getMessageIdBytesin interfaceMessageOrBuilder- Returns:
- The bytes for messageId.
-
setMessageId
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
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
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
Optional. The context id of the message. If set, the message will be associated with the given context.
string context_id = 2;- Specified by:
getContextIdin interfaceMessageOrBuilder- 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:
getContextIdBytesin interfaceMessageOrBuilder- Returns:
- The bytes for contextId.
-
setContextId
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
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
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
Optional. The task id of the message. If set, the message will be associated with the given task.
string task_id = 3;- Specified by:
getTaskIdin interfaceMessageOrBuilder- 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:
getTaskIdBytesin interfaceMessageOrBuilder- Returns:
- The bytes for taskId.
-
setTaskId
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
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
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:
getRoleValuein interfaceMessageOrBuilder- Returns:
- The enum numeric value on the wire for role.
-
setRoleValue
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
Identifies the sender of the message.
.lf.a2a.v1.Role role = 4 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getRolein interfaceMessageOrBuilder- Returns:
- The role.
-
setRole
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
Identifies the sender of the message.
.lf.a2a.v1.Role role = 4 [(.google.api.field_behavior) = REQUIRED];- Returns:
- This builder for chaining.
-
getPartsList
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getPartsListin interfaceMessageOrBuilder
-
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:
getPartsCountin interfaceMessageOrBuilder
-
getParts
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getPartsin interfaceMessageOrBuilder
-
setParts
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
setParts
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
addParts
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
addParts
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
addParts
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
addParts
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
addAllParts
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
clearParts
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
removeParts
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
getPartsBuilder
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
getPartsOrBuilder
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getPartsOrBuilderin interfaceMessageOrBuilder
-
getPartsOrBuilderList
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getPartsOrBuilderListin interfaceMessageOrBuilder
-
addPartsBuilder
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
addPartsBuilder
Parts is the container of the message content.
repeated .lf.a2a.v1.Part parts = 5 [(.google.api.field_behavior) = REQUIRED]; -
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:
hasMetadatain interfaceMessageOrBuilder- 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:
getMetadatain interfaceMessageOrBuilder- Returns:
- The metadata.
-
setMetadata
Optional. Any metadata to provide along with the message.
.google.protobuf.Struct metadata = 6; -
setMetadata
Optional. Any metadata to provide along with the message.
.google.protobuf.Struct metadata = 6; -
mergeMetadata
Optional. Any metadata to provide along with the message.
.google.protobuf.Struct metadata = 6; -
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:
getMetadataOrBuilderin interfaceMessageOrBuilder
-
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:
getExtensionsListin interfaceMessageOrBuilder- 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:
getExtensionsCountin interfaceMessageOrBuilder- Returns:
- The count of extensions.
-
getExtensions
The URIs of extensions that are present or contributed to this Message.
repeated string extensions = 7;- Specified by:
getExtensionsin interfaceMessageOrBuilder- 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:
getExtensionsBytesin interfaceMessageOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the extensions at the given index.
-
setExtensions
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
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
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
The URIs of extensions that are present or contributed to this Message.
repeated string extensions = 7;- Returns:
- This builder for chaining.
-
addExtensionsBytes
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:
getReferenceTaskIdsListin interfaceMessageOrBuilder- 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:
getReferenceTaskIdsCountin interfaceMessageOrBuilder- Returns:
- The count of referenceTaskIds.
-
getReferenceTaskIds
A list of task IDs that this message references for additional context.
repeated string reference_task_ids = 8;- Specified by:
getReferenceTaskIdsin interfaceMessageOrBuilder- 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:
getReferenceTaskIdsBytesin interfaceMessageOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the referenceTaskIds at the given index.
-
setReferenceTaskIds
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
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
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
A list of task IDs that this message references for additional context.
repeated string reference_task_ids = 8;- Returns:
- This builder for chaining.
-
addReferenceTaskIdsBytes
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.
-