Class DocumentTranslation.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<DocumentTranslation.Builder>
com.google.cloud.translate.v3.DocumentTranslation.Builder
All Implemented Interfaces:
DocumentTranslationOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
DocumentTranslation

public static final class DocumentTranslation.Builder extends com.google.protobuf.GeneratedMessage.Builder<DocumentTranslation.Builder> implements DocumentTranslationOrBuilder
 A translated document message.
 
Protobuf type google.cloud.translation.v3.DocumentTranslation
  • 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<DocumentTranslation.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<DocumentTranslation.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<DocumentTranslation.Builder>
    • getDefaultInstanceForType

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

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

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

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

    • isInitialized

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

      public DocumentTranslation.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<DocumentTranslation.Builder>
      Throws:
      IOException
    • getByteStreamOutputsList

      public List<com.google.protobuf.ByteString> getByteStreamOutputsList()
       The array of translated documents. It is expected to be size 1 for now. We
       may produce multiple translated documents in the future for other type of
       file formats.
       
      repeated bytes byte_stream_outputs = 1;
      Specified by:
      getByteStreamOutputsList in interface DocumentTranslationOrBuilder
      Returns:
      A list containing the byteStreamOutputs.
    • getByteStreamOutputsCount

      public int getByteStreamOutputsCount()
       The array of translated documents. It is expected to be size 1 for now. We
       may produce multiple translated documents in the future for other type of
       file formats.
       
      repeated bytes byte_stream_outputs = 1;
      Specified by:
      getByteStreamOutputsCount in interface DocumentTranslationOrBuilder
      Returns:
      The count of byteStreamOutputs.
    • getByteStreamOutputs

      public com.google.protobuf.ByteString getByteStreamOutputs(int index)
       The array of translated documents. It is expected to be size 1 for now. We
       may produce multiple translated documents in the future for other type of
       file formats.
       
      repeated bytes byte_stream_outputs = 1;
      Specified by:
      getByteStreamOutputs in interface DocumentTranslationOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The byteStreamOutputs at the given index.
    • setByteStreamOutputs

      public DocumentTranslation.Builder setByteStreamOutputs(int index, com.google.protobuf.ByteString value)
       The array of translated documents. It is expected to be size 1 for now. We
       may produce multiple translated documents in the future for other type of
       file formats.
       
      repeated bytes byte_stream_outputs = 1;
      Parameters:
      index - The index to set the value at.
      value - The byteStreamOutputs to set.
      Returns:
      This builder for chaining.
    • addByteStreamOutputs

      public DocumentTranslation.Builder addByteStreamOutputs(com.google.protobuf.ByteString value)
       The array of translated documents. It is expected to be size 1 for now. We
       may produce multiple translated documents in the future for other type of
       file formats.
       
      repeated bytes byte_stream_outputs = 1;
      Parameters:
      value - The byteStreamOutputs to add.
      Returns:
      This builder for chaining.
    • addAllByteStreamOutputs

      public DocumentTranslation.Builder addAllByteStreamOutputs(Iterable<? extends com.google.protobuf.ByteString> values)
       The array of translated documents. It is expected to be size 1 for now. We
       may produce multiple translated documents in the future for other type of
       file formats.
       
      repeated bytes byte_stream_outputs = 1;
      Parameters:
      values - The byteStreamOutputs to add.
      Returns:
      This builder for chaining.
    • clearByteStreamOutputs

      public DocumentTranslation.Builder clearByteStreamOutputs()
       The array of translated documents. It is expected to be size 1 for now. We
       may produce multiple translated documents in the future for other type of
       file formats.
       
      repeated bytes byte_stream_outputs = 1;
      Returns:
      This builder for chaining.
    • getMimeType

      public String getMimeType()
       The translated document's mime type.
       
      string mime_type = 2;
      Specified by:
      getMimeType in interface DocumentTranslationOrBuilder
      Returns:
      The mimeType.
    • getMimeTypeBytes

      public com.google.protobuf.ByteString getMimeTypeBytes()
       The translated document's mime type.
       
      string mime_type = 2;
      Specified by:
      getMimeTypeBytes in interface DocumentTranslationOrBuilder
      Returns:
      The bytes for mimeType.
    • setMimeType

      public DocumentTranslation.Builder setMimeType(String value)
       The translated document's mime type.
       
      string mime_type = 2;
      Parameters:
      value - The mimeType to set.
      Returns:
      This builder for chaining.
    • clearMimeType

      public DocumentTranslation.Builder clearMimeType()
       The translated document's mime type.
       
      string mime_type = 2;
      Returns:
      This builder for chaining.
    • setMimeTypeBytes

      public DocumentTranslation.Builder setMimeTypeBytes(com.google.protobuf.ByteString value)
       The translated document's mime type.
       
      string mime_type = 2;
      Parameters:
      value - The bytes for mimeType to set.
      Returns:
      This builder for chaining.
    • getDetectedLanguageCode

      public String getDetectedLanguageCode()
       The detected language for the input document.
       If the user did not provide the source language for the input document,
       this field will have the language code automatically detected. If the
       source language was passed, auto-detection of the language does not occur
       and this field is empty.
       
      string detected_language_code = 3;
      Specified by:
      getDetectedLanguageCode in interface DocumentTranslationOrBuilder
      Returns:
      The detectedLanguageCode.
    • getDetectedLanguageCodeBytes

      public com.google.protobuf.ByteString getDetectedLanguageCodeBytes()
       The detected language for the input document.
       If the user did not provide the source language for the input document,
       this field will have the language code automatically detected. If the
       source language was passed, auto-detection of the language does not occur
       and this field is empty.
       
      string detected_language_code = 3;
      Specified by:
      getDetectedLanguageCodeBytes in interface DocumentTranslationOrBuilder
      Returns:
      The bytes for detectedLanguageCode.
    • setDetectedLanguageCode

      public DocumentTranslation.Builder setDetectedLanguageCode(String value)
       The detected language for the input document.
       If the user did not provide the source language for the input document,
       this field will have the language code automatically detected. If the
       source language was passed, auto-detection of the language does not occur
       and this field is empty.
       
      string detected_language_code = 3;
      Parameters:
      value - The detectedLanguageCode to set.
      Returns:
      This builder for chaining.
    • clearDetectedLanguageCode

      public DocumentTranslation.Builder clearDetectedLanguageCode()
       The detected language for the input document.
       If the user did not provide the source language for the input document,
       this field will have the language code automatically detected. If the
       source language was passed, auto-detection of the language does not occur
       and this field is empty.
       
      string detected_language_code = 3;
      Returns:
      This builder for chaining.
    • setDetectedLanguageCodeBytes

      public DocumentTranslation.Builder setDetectedLanguageCodeBytes(com.google.protobuf.ByteString value)
       The detected language for the input document.
       If the user did not provide the source language for the input document,
       this field will have the language code automatically detected. If the
       source language was passed, auto-detection of the language does not occur
       and this field is empty.
       
      string detected_language_code = 3;
      Parameters:
      value - The bytes for detectedLanguageCode to set.
      Returns:
      This builder for chaining.