Package org.a2aproject.sdk.grpc
Class Part.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Part.Builder>
org.a2aproject.sdk.grpc.Part.Builder
- All Implemented Interfaces:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable,PartOrBuilder
- Enclosing class:
- Part
public static final class Part.Builder
extends com.google.protobuf.GeneratedMessage.Builder<Part.Builder>
implements PartOrBuilder
`Part` represents a container for a section of communication content. Parts can be purely textual, some sort of file (image, video, etc) or a structured data blob (i.e. JSON).Protobuf type
lf.a2a.v1.Part-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).An optional `filename` for the file (e.g., "document.pdf").The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png").Optional. metadata associated with this part.clearRaw()The `raw` byte content of a file.The string content of the `text` part.clearUrl()A `url` pointing to the file's content.com.google.protobuf.ValuegetData()Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).com.google.protobuf.Value.BuilderArbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).com.google.protobuf.ValueOrBuilderArbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorAn optional `filename` for the file (e.g., "document.pdf").com.google.protobuf.ByteStringAn optional `filename` for the file (e.g., "document.pdf").The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png").com.google.protobuf.ByteStringThe `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png").com.google.protobuf.StructOptional. metadata associated with this part.com.google.protobuf.Struct.BuilderOptional. metadata associated with this part.com.google.protobuf.StructOrBuilderOptional. metadata associated with this part.com.google.protobuf.ByteStringgetRaw()The `raw` byte content of a file.getText()The string content of the `text` part.com.google.protobuf.ByteStringThe string content of the `text` part.getUrl()A `url` pointing to the file's content.com.google.protobuf.ByteStringA `url` pointing to the file's content.booleanhasData()Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).booleanOptional. metadata associated with this part.booleanhasRaw()The `raw` byte content of a file.booleanhasText()The string content of the `text` part.booleanhasUrl()A `url` pointing to the file's content.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeData(com.google.protobuf.Value value) Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeMetadata(com.google.protobuf.Struct value) Optional. metadata associated with this part.setData(com.google.protobuf.Value value) Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).setData(com.google.protobuf.Value.Builder builderForValue) Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).setFilename(String value) An optional `filename` for the file (e.g., "document.pdf").setFilenameBytes(com.google.protobuf.ByteString value) An optional `filename` for the file (e.g., "document.pdf").setMediaType(String value) The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png").setMediaTypeBytes(com.google.protobuf.ByteString value) The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png").setMetadata(com.google.protobuf.Struct value) Optional. metadata associated with this part.setMetadata(com.google.protobuf.Struct.Builder builderForValue) Optional. metadata associated with this part.setRaw(com.google.protobuf.ByteString value) The `raw` byte content of a file.The string content of the `text` part.setTextBytes(com.google.protobuf.ByteString value) The string content of the `text` part.A `url` pointing to the file's content.setUrlBytes(com.google.protobuf.ByteString value) A `url` pointing to the file's content.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<Part.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<Part.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<Part.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<Part.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<Part.Builder>
-
mergeFrom
public Part.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<Part.Builder>- Throws:
IOException
-
getContentCase
- Specified by:
getContentCasein interfacePartOrBuilder
-
clearContent
-
hasText
public boolean hasText()The string content of the `text` part.
string text = 1;- Specified by:
hasTextin interfacePartOrBuilder- Returns:
- Whether the text field is set.
-
getText
The string content of the `text` part.
string text = 1;- Specified by:
getTextin interfacePartOrBuilder- Returns:
- The text.
-
getTextBytes
public com.google.protobuf.ByteString getTextBytes()The string content of the `text` part.
string text = 1;- Specified by:
getTextBytesin interfacePartOrBuilder- Returns:
- The bytes for text.
-
setText
The string content of the `text` part.
string text = 1;- Parameters:
value- The text to set.- Returns:
- This builder for chaining.
-
clearText
The string content of the `text` part.
string text = 1;- Returns:
- This builder for chaining.
-
setTextBytes
The string content of the `text` part.
string text = 1;- Parameters:
value- The bytes for text to set.- Returns:
- This builder for chaining.
-
hasRaw
public boolean hasRaw()The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
bytes raw = 2;- Specified by:
hasRawin interfacePartOrBuilder- Returns:
- Whether the raw field is set.
-
getRaw
public com.google.protobuf.ByteString getRaw()The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
bytes raw = 2;- Specified by:
getRawin interfacePartOrBuilder- Returns:
- The raw.
-
setRaw
The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
bytes raw = 2;- Parameters:
value- The raw to set.- Returns:
- This builder for chaining.
-
clearRaw
The `raw` byte content of a file. In JSON serialization, this is encoded as a base64 string.
bytes raw = 2;- Returns:
- This builder for chaining.
-
hasUrl
public boolean hasUrl()A `url` pointing to the file's content.
string url = 3;- Specified by:
hasUrlin interfacePartOrBuilder- Returns:
- Whether the url field is set.
-
getUrl
A `url` pointing to the file's content.
string url = 3;- Specified by:
getUrlin interfacePartOrBuilder- Returns:
- The url.
-
getUrlBytes
public com.google.protobuf.ByteString getUrlBytes()A `url` pointing to the file's content.
string url = 3;- Specified by:
getUrlBytesin interfacePartOrBuilder- Returns:
- The bytes for url.
-
setUrl
A `url` pointing to the file's content.
string url = 3;- Parameters:
value- The url to set.- Returns:
- This builder for chaining.
-
clearUrl
A `url` pointing to the file's content.
string url = 3;- Returns:
- This builder for chaining.
-
setUrlBytes
A `url` pointing to the file's content.
string url = 3;- Parameters:
value- The bytes for url to set.- Returns:
- This builder for chaining.
-
hasData
public boolean hasData()Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
.google.protobuf.Value data = 4;- Specified by:
hasDatain interfacePartOrBuilder- Returns:
- Whether the data field is set.
-
getData
public com.google.protobuf.Value getData()Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
.google.protobuf.Value data = 4;- Specified by:
getDatain interfacePartOrBuilder- Returns:
- The data.
-
setData
Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
.google.protobuf.Value data = 4; -
setData
Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
.google.protobuf.Value data = 4; -
mergeData
Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
.google.protobuf.Value data = 4; -
clearData
Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
.google.protobuf.Value data = 4; -
getDataBuilder
public com.google.protobuf.Value.Builder getDataBuilder()Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
.google.protobuf.Value data = 4; -
getDataOrBuilder
public com.google.protobuf.ValueOrBuilder getDataOrBuilder()Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
.google.protobuf.Value data = 4;- Specified by:
getDataOrBuilderin interfacePartOrBuilder
-
hasMetadata
public boolean hasMetadata()Optional. metadata associated with this part.
.google.protobuf.Struct metadata = 5;- Specified by:
hasMetadatain interfacePartOrBuilder- Returns:
- Whether the metadata field is set.
-
getMetadata
public com.google.protobuf.Struct getMetadata()Optional. metadata associated with this part.
.google.protobuf.Struct metadata = 5;- Specified by:
getMetadatain interfacePartOrBuilder- Returns:
- The metadata.
-
setMetadata
Optional. metadata associated with this part.
.google.protobuf.Struct metadata = 5; -
setMetadata
Optional. metadata associated with this part.
.google.protobuf.Struct metadata = 5; -
mergeMetadata
Optional. metadata associated with this part.
.google.protobuf.Struct metadata = 5; -
clearMetadata
Optional. metadata associated with this part.
.google.protobuf.Struct metadata = 5; -
getMetadataBuilder
public com.google.protobuf.Struct.Builder getMetadataBuilder()Optional. metadata associated with this part.
.google.protobuf.Struct metadata = 5; -
getMetadataOrBuilder
public com.google.protobuf.StructOrBuilder getMetadataOrBuilder()Optional. metadata associated with this part.
.google.protobuf.Struct metadata = 5;- Specified by:
getMetadataOrBuilderin interfacePartOrBuilder
-
getFilename
An optional `filename` for the file (e.g., "document.pdf").
string filename = 6;- Specified by:
getFilenamein interfacePartOrBuilder- Returns:
- The filename.
-
getFilenameBytes
public com.google.protobuf.ByteString getFilenameBytes()An optional `filename` for the file (e.g., "document.pdf").
string filename = 6;- Specified by:
getFilenameBytesin interfacePartOrBuilder- Returns:
- The bytes for filename.
-
setFilename
An optional `filename` for the file (e.g., "document.pdf").
string filename = 6;- Parameters:
value- The filename to set.- Returns:
- This builder for chaining.
-
clearFilename
An optional `filename` for the file (e.g., "document.pdf").
string filename = 6;- Returns:
- This builder for chaining.
-
setFilenameBytes
An optional `filename` for the file (e.g., "document.pdf").
string filename = 6;- Parameters:
value- The bytes for filename to set.- Returns:
- This builder for chaining.
-
getMediaType
The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
string media_type = 7;- Specified by:
getMediaTypein interfacePartOrBuilder- Returns:
- The mediaType.
-
getMediaTypeBytes
public com.google.protobuf.ByteString getMediaTypeBytes()The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
string media_type = 7;- Specified by:
getMediaTypeBytesin interfacePartOrBuilder- Returns:
- The bytes for mediaType.
-
setMediaType
The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
string media_type = 7;- Parameters:
value- The mediaType to set.- Returns:
- This builder for chaining.
-
clearMediaType
The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
string media_type = 7;- Returns:
- This builder for chaining.
-
setMediaTypeBytes
The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png"). This field is available for all part types.
string media_type = 7;- Parameters:
value- The bytes for mediaType to set.- Returns:
- This builder for chaining.
-