Class Translation.Builder (2.30.0)

public static final class Translation.Builder extends GeneratedMessageV3.Builder<Translation.Builder> implements TranslationOrBuilder

A single translation response.

Protobuf type google.cloud.translation.v3beta1.Translation

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Translation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Translation.Builder
Overrides

build()

public Translation build()
Returns
TypeDescription
Translation

buildPartial()

public Translation buildPartial()
Returns
TypeDescription
Translation

clear()

public Translation.Builder clear()
Returns
TypeDescription
Translation.Builder
Overrides

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
TypeDescription
Translation.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Translation.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Translation.Builder
Overrides

clearGlossaryConfig()

public Translation.Builder clearGlossaryConfig()

The glossary_config used for this translation.

.google.cloud.translation.v3beta1.TranslateTextGlossaryConfig glossary_config = 3;

Returns
TypeDescription
Translation.Builder

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
TypeDescription
Translation.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Translation.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Translation.Builder
Overrides

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
TypeDescription
Translation.Builder

This builder for chaining.

clone()

public Translation.Builder clone()
Returns
TypeDescription
Translation.Builder
Overrides

getDefaultInstanceForType()

public Translation getDefaultInstanceForType()
Returns
TypeDescription
Translation

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

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