Class Translation.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
- com.google.cloud.translate.v3beta1.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.GeneratedMessageV3.Builder<Translation.Builder> implements TranslationOrBuilder
A single translation response.
Protobuf typegoogle.cloud.translation.v3beta1.Translation
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Translation.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)Translationbuild()TranslationbuildPartial()Translation.Builderclear()Translation.BuilderclearDetectedLanguageCode()The BCP-47 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request.Translation.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)Translation.BuilderclearGlossaryConfig()The `glossary_config` used for this translation.Translation.BuilderclearModel()Only present when `model` is present in the request.Translation.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)Translation.BuilderclearTranslatedText()Text translated into the target language.Translation.Builderclone()TranslationgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()StringgetDetectedLanguageCode()The BCP-47 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request.com.google.protobuf.ByteStringgetDetectedLanguageCodeBytes()The BCP-47 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request.TranslateTextGlossaryConfiggetGlossaryConfig()The `glossary_config` used for this translation.TranslateTextGlossaryConfig.BuildergetGlossaryConfigBuilder()The `glossary_config` used for this translation.TranslateTextGlossaryConfigOrBuildergetGlossaryConfigOrBuilder()The `glossary_config` used for this translation.StringgetModel()Only present when `model` is present in the request.com.google.protobuf.ByteStringgetModelBytes()Only present when `model` is present in the request.StringgetTranslatedText()Text translated into the target language.com.google.protobuf.ByteStringgetTranslatedTextBytes()Text translated into the target language.booleanhasGlossaryConfig()The `glossary_config` used for this translation.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()Translation.BuildermergeFrom(Translation other)Translation.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)Translation.BuildermergeFrom(com.google.protobuf.Message other)Translation.BuildermergeGlossaryConfig(TranslateTextGlossaryConfig value)The `glossary_config` used for this translation.Translation.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)Translation.BuildersetDetectedLanguageCode(String value)The BCP-47 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request.Translation.BuildersetDetectedLanguageCodeBytes(com.google.protobuf.ByteString value)The BCP-47 language code of source text in the initial request, detected automatically, if no source language was passed within the initial request.Translation.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)Translation.BuildersetGlossaryConfig(TranslateTextGlossaryConfig value)The `glossary_config` used for this translation.Translation.BuildersetGlossaryConfig(TranslateTextGlossaryConfig.Builder builderForValue)The `glossary_config` used for this translation.Translation.BuildersetModel(String value)Only present when `model` is present in the request.Translation.BuildersetModelBytes(com.google.protobuf.ByteString value)Only present when `model` is present in the request.Translation.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)Translation.BuildersetTranslatedText(String value)Text translated into the target language.Translation.BuildersetTranslatedTextBytes(com.google.protobuf.ByteString value)Text translated into the target language.Translation.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, 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
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
clear
public Translation.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.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.GeneratedMessageV3.Builder<Translation.Builder>
-
getDefaultInstanceForType
public Translation getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public Translation build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public Translation buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public Translation.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
setField
public Translation.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
clearField
public Translation.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
clearOneof
public Translation.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
setRepeatedField
public Translation.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
addRepeatedField
public Translation.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
mergeFrom
public Translation.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Translation.Builder>
-
mergeFrom
public Translation.Builder mergeFrom(Translation other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
mergeFrom
public Translation.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<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:
getTranslatedTextin interfaceTranslationOrBuilder- 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:
getTranslatedTextBytesin interfaceTranslationOrBuilder- 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:
getModelin interfaceTranslationOrBuilder- 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:
getModelBytesin interfaceTranslationOrBuilder- 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 BCP-47 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:
getDetectedLanguageCodein interfaceTranslationOrBuilder- Returns:
- The detectedLanguageCode.
-
getDetectedLanguageCodeBytes
public com.google.protobuf.ByteString getDetectedLanguageCodeBytes()
The BCP-47 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:
getDetectedLanguageCodeBytesin interfaceTranslationOrBuilder- Returns:
- The bytes for detectedLanguageCode.
-
setDetectedLanguageCode
public Translation.Builder setDetectedLanguageCode(String value)
The BCP-47 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 BCP-47 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 BCP-47 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.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;- Specified by:
hasGlossaryConfigin interfaceTranslationOrBuilder- Returns:
- Whether the glossaryConfig field is set.
-
getGlossaryConfig
public TranslateTextGlossaryConfig getGlossaryConfig()
The `glossary_config` used for this translation.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;- Specified by:
getGlossaryConfigin interfaceTranslationOrBuilder- Returns:
- The glossaryConfig.
-
setGlossaryConfig
public Translation.Builder setGlossaryConfig(TranslateTextGlossaryConfig value)
The `glossary_config` used for this translation.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;
-
setGlossaryConfig
public Translation.Builder setGlossaryConfig(TranslateTextGlossaryConfig.Builder builderForValue)
The `glossary_config` used for this translation.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;
-
mergeGlossaryConfig
public Translation.Builder mergeGlossaryConfig(TranslateTextGlossaryConfig value)
The `glossary_config` used for this translation.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;
-
clearGlossaryConfig
public Translation.Builder clearGlossaryConfig()
The `glossary_config` used for this translation.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;
-
getGlossaryConfigBuilder
public TranslateTextGlossaryConfig.Builder getGlossaryConfigBuilder()
The `glossary_config` used for this translation.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;
-
getGlossaryConfigOrBuilder
public TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder()
The `glossary_config` used for this translation.
.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;- Specified by:
getGlossaryConfigOrBuilderin interfaceTranslationOrBuilder
-
setUnknownFields
public final Translation.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
mergeUnknownFields
public final Translation.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>
-
-