public static final class Translation.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder> implements TranslationOrBuilder
A single translation response.Protobuf type
google.cloud.translation.v3.Translation| Modifier and Type | Method and Description |
|---|---|
Translation.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
Translation |
build() |
Translation |
buildPartial() |
Translation.Builder |
clear() |
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.
|
Translation.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
Translation.Builder |
clearGlossaryConfig()
The `glossary_config` used for this translation.
|
Translation.Builder |
clearModel()
Only present when `model` is present in the request.
|
Translation.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
Translation.Builder |
clearTranslatedText()
Text translated into the target language.
|
Translation.Builder |
clone() |
Translation |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
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.
|
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.
|
TranslateTextGlossaryConfig |
getGlossaryConfig()
The `glossary_config` used for this translation.
|
TranslateTextGlossaryConfig.Builder |
getGlossaryConfigBuilder()
The `glossary_config` used for this translation.
|
TranslateTextGlossaryConfigOrBuilder |
getGlossaryConfigOrBuilder()
The `glossary_config` used for this translation.
|
String |
getModel()
Only present when `model` is present in the request.
|
com.google.protobuf.ByteString |
getModelBytes()
Only present when `model` is present in the request.
|
String |
getTranslatedText()
Text translated into the target language.
|
com.google.protobuf.ByteString |
getTranslatedTextBytes()
Text translated into the target language.
|
boolean |
hasGlossaryConfig()
The `glossary_config` used for this translation.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
Translation.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
Translation.Builder |
mergeFrom(com.google.protobuf.Message other) |
Translation.Builder |
mergeFrom(Translation other) |
Translation.Builder |
mergeGlossaryConfig(TranslateTextGlossaryConfig value)
The `glossary_config` used for this translation.
|
Translation.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
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.
|
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.
|
Translation.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
Translation.Builder |
setGlossaryConfig(TranslateTextGlossaryConfig.Builder builderForValue)
The `glossary_config` used for this translation.
|
Translation.Builder |
setGlossaryConfig(TranslateTextGlossaryConfig value)
The `glossary_config` used for this translation.
|
Translation.Builder |
setModel(String value)
Only present when `model` is present in the request.
|
Translation.Builder |
setModelBytes(com.google.protobuf.ByteString value)
Only present when `model` is present in the request.
|
Translation.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
Translation.Builder |
setTranslatedText(String value)
Text translated into the target language.
|
Translation.Builder |
setTranslatedTextBytes(com.google.protobuf.ByteString value)
Text translated into the target language.
|
Translation.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public Translation.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public Translation getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic Translation build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic Translation buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic Translation.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public Translation.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public Translation.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public Translation.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public Translation.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public Translation.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public Translation.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<Translation.Builder>public Translation.Builder mergeFrom(Translation other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public Translation.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<Translation.Builder>IOExceptionpublic 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;getTranslatedText in interface TranslationOrBuilderpublic 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;getTranslatedTextBytes in interface TranslationOrBuilderpublic 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;value - The translatedText to set.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;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;value - The bytes for translatedText to set.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;getModel in interface TranslationOrBuilderpublic 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;getModelBytes in interface TranslationOrBuilderpublic 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;value - The model to set.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;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;value - The bytes for model to set.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;getDetectedLanguageCode in interface TranslationOrBuilderpublic 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;getDetectedLanguageCodeBytes in interface TranslationOrBuilderpublic 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;value - The detectedLanguageCode to set.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;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;value - The bytes for detectedLanguageCode to set.public boolean hasGlossaryConfig()
The `glossary_config` used for this translation.
.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;hasGlossaryConfig in interface TranslationOrBuilderpublic TranslateTextGlossaryConfig getGlossaryConfig()
The `glossary_config` used for this translation.
.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;getGlossaryConfig in interface TranslationOrBuilderpublic Translation.Builder setGlossaryConfig(TranslateTextGlossaryConfig value)
The `glossary_config` used for this translation.
.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;public Translation.Builder setGlossaryConfig(TranslateTextGlossaryConfig.Builder builderForValue)
The `glossary_config` used for this translation.
.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;public Translation.Builder mergeGlossaryConfig(TranslateTextGlossaryConfig value)
The `glossary_config` used for this translation.
.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;public Translation.Builder clearGlossaryConfig()
The `glossary_config` used for this translation.
.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;public TranslateTextGlossaryConfig.Builder getGlossaryConfigBuilder()
The `glossary_config` used for this translation.
.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;public TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder()
The `glossary_config` used for this translation.
.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;getGlossaryConfigOrBuilder in interface TranslationOrBuilderpublic final Translation.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>public final Translation.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Translation.Builder>Copyright © 2022 Google LLC. All rights reserved.