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 Type
    Method
    Description
     
     
     
     
    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.
    The `raw` byte content of a file.
    The string content of the `text` part.
    A `url` pointing to the file's content.
     
    com.google.protobuf.Value
    Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
    com.google.protobuf.Value.Builder
    Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
    com.google.protobuf.ValueOrBuilder
    Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    An optional `filename` for the file (e.g., "document.pdf").
    com.google.protobuf.ByteString
    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").
    com.google.protobuf.ByteString
    The `media_type` (MIME type) of the part content (e.g., "text/plain", "application/json", "image/png").
    com.google.protobuf.Struct
    Optional. metadata associated with this part.
    com.google.protobuf.Struct.Builder
    Optional. metadata associated with this part.
    com.google.protobuf.StructOrBuilder
    Optional. metadata associated with this part.
    com.google.protobuf.ByteString
    The `raw` byte content of a file.
    The string content of the `text` part.
    com.google.protobuf.ByteString
    The string content of the `text` part.
    A `url` pointing to the file's content.
    com.google.protobuf.ByteString
    A `url` pointing to the file's content.
    boolean
    Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
    boolean
    Optional. metadata associated with this part.
    boolean
    The `raw` byte content of a file.
    boolean
    The string content of the `text` part.
    boolean
    A `url` pointing to the file's content.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
    mergeData(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)
     
    mergeFrom(Part 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).
    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").
    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.
    setText(String value)
    The string content of the `text` part.
    setTextBytes(com.google.protobuf.ByteString value)
    The string content of the `text` part.
    setUrl(String value)
    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, setUnknownFieldsProto3

    Methods inherited from class com.google.protobuf.AbstractMessage.Builder

    findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods 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:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Part.Builder>
    • clear

      public Part.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<Part.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<Part.Builder>
    • getDefaultInstanceForType

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

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

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

      public Part.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<Part.Builder>
    • mergeFrom

      public Part.Builder mergeFrom(Part other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.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:
      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<Part.Builder>
      Throws:
      IOException
    • getContentCase

      public Part.ContentCase getContentCase()
      Specified by:
      getContentCase in interface PartOrBuilder
    • clearContent

      public Part.Builder clearContent()
    • hasText

      public boolean hasText()
       The string content of the `text` part.
       
      string text = 1;
      Specified by:
      hasText in interface PartOrBuilder
      Returns:
      Whether the text field is set.
    • getText

      public String getText()
       The string content of the `text` part.
       
      string text = 1;
      Specified by:
      getText in interface PartOrBuilder
      Returns:
      The text.
    • getTextBytes

      public com.google.protobuf.ByteString getTextBytes()
       The string content of the `text` part.
       
      string text = 1;
      Specified by:
      getTextBytes in interface PartOrBuilder
      Returns:
      The bytes for text.
    • setText

      public Part.Builder setText(String value)
       The string content of the `text` part.
       
      string text = 1;
      Parameters:
      value - The text to set.
      Returns:
      This builder for chaining.
    • clearText

      public Part.Builder clearText()
       The string content of the `text` part.
       
      string text = 1;
      Returns:
      This builder for chaining.
    • setTextBytes

      public Part.Builder setTextBytes(com.google.protobuf.ByteString value)
       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:
      hasRaw in interface PartOrBuilder
      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:
      getRaw in interface PartOrBuilder
      Returns:
      The raw.
    • setRaw

      public Part.Builder setRaw(com.google.protobuf.ByteString value)
       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

      public Part.Builder 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:
      hasUrl in interface PartOrBuilder
      Returns:
      Whether the url field is set.
    • getUrl

      public String getUrl()
       A `url` pointing to the file's content.
       
      string url = 3;
      Specified by:
      getUrl in interface PartOrBuilder
      Returns:
      The url.
    • getUrlBytes

      public com.google.protobuf.ByteString getUrlBytes()
       A `url` pointing to the file's content.
       
      string url = 3;
      Specified by:
      getUrlBytes in interface PartOrBuilder
      Returns:
      The bytes for url.
    • setUrl

      public Part.Builder setUrl(String value)
       A `url` pointing to the file's content.
       
      string url = 3;
      Parameters:
      value - The url to set.
      Returns:
      This builder for chaining.
    • clearUrl

      public Part.Builder clearUrl()
       A `url` pointing to the file's content.
       
      string url = 3;
      Returns:
      This builder for chaining.
    • setUrlBytes

      public Part.Builder setUrlBytes(com.google.protobuf.ByteString value)
       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:
      hasData in interface PartOrBuilder
      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:
      getData in interface PartOrBuilder
      Returns:
      The data.
    • setData

      public Part.Builder setData(com.google.protobuf.Value value)
       Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
       
      .google.protobuf.Value data = 4;
    • setData

      public Part.Builder setData(com.google.protobuf.Value.Builder builderForValue)
       Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
       
      .google.protobuf.Value data = 4;
    • mergeData

      public Part.Builder mergeData(com.google.protobuf.Value value)
       Arbitrary structured `data` as a JSON value (object, array, string, number, boolean, or null).
       
      .google.protobuf.Value data = 4;
    • clearData

      public Part.Builder 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:
      getDataOrBuilder in interface PartOrBuilder
    • hasMetadata

      public boolean hasMetadata()
       Optional. metadata associated with this part.
       
      .google.protobuf.Struct metadata = 5;
      Specified by:
      hasMetadata in interface PartOrBuilder
      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:
      getMetadata in interface PartOrBuilder
      Returns:
      The metadata.
    • setMetadata

      public Part.Builder setMetadata(com.google.protobuf.Struct value)
       Optional. metadata associated with this part.
       
      .google.protobuf.Struct metadata = 5;
    • setMetadata

      public Part.Builder setMetadata(com.google.protobuf.Struct.Builder builderForValue)
       Optional. metadata associated with this part.
       
      .google.protobuf.Struct metadata = 5;
    • mergeMetadata

      public Part.Builder mergeMetadata(com.google.protobuf.Struct value)
       Optional. metadata associated with this part.
       
      .google.protobuf.Struct metadata = 5;
    • clearMetadata

      public Part.Builder 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:
      getMetadataOrBuilder in interface PartOrBuilder
    • getFilename

      public String getFilename()
       An optional `filename` for the file (e.g., "document.pdf").
       
      string filename = 6;
      Specified by:
      getFilename in interface PartOrBuilder
      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:
      getFilenameBytes in interface PartOrBuilder
      Returns:
      The bytes for filename.
    • setFilename

      public Part.Builder setFilename(String value)
       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

      public Part.Builder clearFilename()
       An optional `filename` for the file (e.g., "document.pdf").
       
      string filename = 6;
      Returns:
      This builder for chaining.
    • setFilenameBytes

      public Part.Builder setFilenameBytes(com.google.protobuf.ByteString value)
       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

      public String 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:
      getMediaType in interface PartOrBuilder
      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:
      getMediaTypeBytes in interface PartOrBuilder
      Returns:
      The bytes for mediaType.
    • setMediaType

      public Part.Builder setMediaType(String value)
       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

      public Part.Builder 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

      public Part.Builder setMediaTypeBytes(com.google.protobuf.ByteString value)
       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.