Class Translation.Builder

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

public static final class Translation.Builder extends com.google.protobuf.GeneratedMessage.Builder<Translation.Builder> implements TranslationOrBuilder
 A single translation response.
 
Protobuf type google.cloud.translation.v3.Translation
  • 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<Translation.Builder>
    • clear

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

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

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

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

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

      public Translation.Builder mergeFrom(Translation other)
    • isInitialized

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

      public Translation.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<Translation.Builder>
      Throws:
      IOException
    • getTranslatedText

      public String getTranslatedText()
       Text translated into the target language.
       If an error occurs during translation, this field might be excluded from
       the response.
       
      string translated_text = 1;
      Specified by:
      getTranslatedText in interface TranslationOrBuilder
      Returns:
      The translatedText.
    • getTranslatedTextBytes

      public com.google.protobuf.ByteString getTranslatedTextBytes()
       Text translated into the target language.
       If an error occurs during translation, this field might be excluded from
       the response.
       
      string translated_text = 1;
      Specified by:
      getTranslatedTextBytes in interface TranslationOrBuilder
      Returns:
      The bytes for translatedText.
    • setTranslatedText

      public Translation.Builder setTranslatedText(String value)
       Text translated into the target language.
       If an error occurs during translation, this field might be excluded from
       the response.
       
      string translated_text = 1;
      Parameters:
      value - The translatedText to set.
      Returns:
      This builder for chaining.
    • clearTranslatedText

      public Translation.Builder clearTranslatedText()
       Text translated into the target language.
       If an error occurs during translation, this field might be excluded from
       the response.
       
      string translated_text = 1;
      Returns:
      This builder for chaining.
    • setTranslatedTextBytes

      public Translation.Builder setTranslatedTextBytes(com.google.protobuf.ByteString value)
       Text translated into the target language.
       If an error occurs during translation, this field might be excluded from
       the response.
       
      string translated_text = 1;
      Parameters:
      value - The bytes for translatedText to set.
      Returns:
      This builder for chaining.
    • getModel

      public String getModel()
       Only present when `model` is present in the request.
       `model` here is normalized to have project number.
      
       For example:
       If the `model` requested in TranslationTextRequest is
       `projects/{project-id}/locations/{location-id}/models/general/nmt` then
       `model` here would be normalized to
       `projects/{project-number}/locations/{location-id}/models/general/nmt`.
       
      string model = 2;
      Specified by:
      getModel in interface TranslationOrBuilder
      Returns:
      The model.
    • getModelBytes

      public com.google.protobuf.ByteString getModelBytes()
       Only present when `model` is present in the request.
       `model` here is normalized to have project number.
      
       For example:
       If the `model` requested in TranslationTextRequest is
       `projects/{project-id}/locations/{location-id}/models/general/nmt` then
       `model` here would be normalized to
       `projects/{project-number}/locations/{location-id}/models/general/nmt`.
       
      string model = 2;
      Specified by:
      getModelBytes in interface TranslationOrBuilder
      Returns:
      The bytes for model.
    • setModel

      public Translation.Builder setModel(String value)
       Only present when `model` is present in the request.
       `model` here is normalized to have project number.
      
       For example:
       If the `model` requested in TranslationTextRequest is
       `projects/{project-id}/locations/{location-id}/models/general/nmt` then
       `model` here would be normalized to
       `projects/{project-number}/locations/{location-id}/models/general/nmt`.
       
      string model = 2;
      Parameters:
      value - The model to set.
      Returns:
      This builder for chaining.
    • clearModel

      public Translation.Builder clearModel()
       Only present when `model` is present in the request.
       `model` here is normalized to have project number.
      
       For example:
       If the `model` requested in TranslationTextRequest is
       `projects/{project-id}/locations/{location-id}/models/general/nmt` then
       `model` here would be normalized to
       `projects/{project-number}/locations/{location-id}/models/general/nmt`.
       
      string model = 2;
      Returns:
      This builder for chaining.
    • setModelBytes

      public Translation.Builder setModelBytes(com.google.protobuf.ByteString value)
       Only present when `model` is present in the request.
       `model` here is normalized to have project number.
      
       For example:
       If the `model` requested in TranslationTextRequest is
       `projects/{project-id}/locations/{location-id}/models/general/nmt` then
       `model` here would be normalized to
       `projects/{project-number}/locations/{location-id}/models/general/nmt`.
       
      string model = 2;
      Parameters:
      value - The bytes for model to set.
      Returns:
      This builder for chaining.
    • getDetectedLanguageCode

      public String getDetectedLanguageCode()
       The ISO-639 language code of source text in the initial request, detected
       automatically, if no source language was passed within the initial
       request. If the source language was passed, auto-detection of the language
       does not occur and this field is empty.
       
      string detected_language_code = 4;
      Specified by:
      getDetectedLanguageCode in interface TranslationOrBuilder
      Returns:
      The detectedLanguageCode.
    • getDetectedLanguageCodeBytes

      public com.google.protobuf.ByteString getDetectedLanguageCodeBytes()
       The ISO-639 language code of source text in the initial request, detected
       automatically, if no source language was passed within the initial
       request. If the source language was passed, auto-detection of the language
       does not occur and this field is empty.
       
      string detected_language_code = 4;
      Specified by:
      getDetectedLanguageCodeBytes in interface TranslationOrBuilder
      Returns:
      The bytes for detectedLanguageCode.
    • setDetectedLanguageCode

      public Translation.Builder setDetectedLanguageCode(String value)
       The ISO-639 language code of source text in the initial request, detected
       automatically, if no source language was passed within the initial
       request. If the source language was passed, auto-detection of the language
       does not occur and this field is empty.
       
      string detected_language_code = 4;
      Parameters:
      value - The detectedLanguageCode to set.
      Returns:
      This builder for chaining.
    • clearDetectedLanguageCode

      public Translation.Builder clearDetectedLanguageCode()
       The ISO-639 language code of source text in the initial request, detected
       automatically, if no source language was passed within the initial
       request. If the source language was passed, auto-detection of the language
       does not occur and this field is empty.
       
      string detected_language_code = 4;
      Returns:
      This builder for chaining.
    • setDetectedLanguageCodeBytes

      public Translation.Builder setDetectedLanguageCodeBytes(com.google.protobuf.ByteString value)
       The ISO-639 language code of source text in the initial request, detected
       automatically, if no source language was passed within the initial
       request. If the source language was passed, auto-detection of the language
       does not occur and this field is empty.
       
      string detected_language_code = 4;
      Parameters:
      value - The bytes for detectedLanguageCode to set.
      Returns:
      This builder for chaining.
    • hasGlossaryConfig

      public boolean hasGlossaryConfig()
       The `glossary_config` used for this translation.
       
      .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;
      Specified by:
      hasGlossaryConfig in interface TranslationOrBuilder
      Returns:
      Whether the glossaryConfig field is set.
    • getGlossaryConfig

      public TranslateTextGlossaryConfig getGlossaryConfig()
       The `glossary_config` used for this translation.
       
      .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;
      Specified by:
      getGlossaryConfig in interface TranslationOrBuilder
      Returns:
      The glossaryConfig.
    • setGlossaryConfig

      public Translation.Builder setGlossaryConfig(TranslateTextGlossaryConfig value)
       The `glossary_config` used for this translation.
       
      .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;
    • setGlossaryConfig

      public Translation.Builder setGlossaryConfig(TranslateTextGlossaryConfig.Builder builderForValue)
       The `glossary_config` used for this translation.
       
      .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;
    • mergeGlossaryConfig

      public Translation.Builder mergeGlossaryConfig(TranslateTextGlossaryConfig value)
       The `glossary_config` used for this translation.
       
      .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;
    • clearGlossaryConfig

      public Translation.Builder clearGlossaryConfig()
       The `glossary_config` used for this translation.
       
      .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;
    • getGlossaryConfigBuilder

      public TranslateTextGlossaryConfig.Builder getGlossaryConfigBuilder()
       The `glossary_config` used for this translation.
       
      .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;
    • getGlossaryConfigOrBuilder

      public TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder()
       The `glossary_config` used for this translation.
       
      .google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;
      Specified by:
      getGlossaryConfigOrBuilder in interface TranslationOrBuilder