public static final class Translation.Builder extends 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(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(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(Descriptors.OneofDescriptor oneof) |
Translation.Builder |
clearTranslatedText()
Text translated into the target language.
|
Translation.Builder |
clone() |
Translation |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
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.
|
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.
|
ByteString |
getModelBytes()
Only present when `model` is present in the request.
|
String |
getTranslatedText()
Text translated into the target language.
|
ByteString |
getTranslatedTextBytes()
Text translated into the target language.
|
boolean |
hasGlossaryConfig()
The `glossary_config` used for this translation.
|
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
Translation.Builder |
mergeFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
Translation.Builder |
mergeFrom(Message other) |
Translation.Builder |
mergeFrom(Translation other) |
Translation.Builder |
mergeGlossaryConfig(TranslateTextGlossaryConfig value)
The `glossary_config` used for this translation.
|
Translation.Builder |
mergeUnknownFields(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(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(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(ByteString value)
Only present when `model` is present in the request.
|
Translation.Builder |
setRepeatedField(Descriptors.FieldDescriptor field,
int index,
Object value) |
Translation.Builder |
setTranslatedText(String value)
Text translated into the target language.
|
Translation.Builder |
setTranslatedTextBytes(ByteString value)
Text translated into the target language.
|
Translation.Builder |
setUnknownFields(UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
mergeDelimitedFrom, mergeDelimitedFrom
mergeFrom
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3.Builder<Translation.Builder>
public Translation.Builder clear()
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class GeneratedMessageV3.Builder<Translation.Builder>
public Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class GeneratedMessageV3.Builder<Translation.Builder>
public Translation getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public Translation build()
build
in interface Message.Builder
build
in interface MessageLite.Builder
public Translation buildPartial()
buildPartial
in interface Message.Builder
buildPartial
in interface MessageLite.Builder
public Translation.Builder clone()
clone
in interface Message.Builder
clone
in interface MessageLite.Builder
clone
in class GeneratedMessageV3.Builder<Translation.Builder>
public Translation.Builder setField(Descriptors.FieldDescriptor field, Object value)
setField
in interface Message.Builder
setField
in class GeneratedMessageV3.Builder<Translation.Builder>
public Translation.Builder clearField(Descriptors.FieldDescriptor field)
clearField
in interface Message.Builder
clearField
in class GeneratedMessageV3.Builder<Translation.Builder>
public Translation.Builder clearOneof(Descriptors.OneofDescriptor oneof)
clearOneof
in interface Message.Builder
clearOneof
in class GeneratedMessageV3.Builder<Translation.Builder>
public Translation.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField
in interface Message.Builder
setRepeatedField
in class GeneratedMessageV3.Builder<Translation.Builder>
public Translation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
addRepeatedField
in interface Message.Builder
addRepeatedField
in class GeneratedMessageV3.Builder<Translation.Builder>
public Translation.Builder mergeFrom(Message other)
mergeFrom
in interface Message.Builder
mergeFrom
in class AbstractMessage.Builder<Translation.Builder>
public Translation.Builder mergeFrom(Translation other)
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3.Builder<Translation.Builder>
public Translation.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom
in interface Message.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessage.Builder<Translation.Builder>
IOException
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;
getTranslatedText
in interface TranslationOrBuilder
public 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 TranslationOrBuilder
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;
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(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 TranslationOrBuilder
public 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 TranslationOrBuilder
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;
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(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 TranslationOrBuilder
public 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 TranslationOrBuilder
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;
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(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 TranslationOrBuilder
public TranslateTextGlossaryConfig getGlossaryConfig()
The `glossary_config` used for this translation.
.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 3;
getGlossaryConfig
in interface TranslationOrBuilder
public 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 TranslationOrBuilder
public final Translation.Builder setUnknownFields(UnknownFieldSet unknownFields)
setUnknownFields
in interface Message.Builder
setUnknownFields
in class GeneratedMessageV3.Builder<Translation.Builder>
public final Translation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class GeneratedMessageV3.Builder<Translation.Builder>
Copyright © 2022 Google LLC. All rights reserved.