Class TranslateDocumentResponse.Builder (2.53.0)

public static final class TranslateDocumentResponse.Builder extends GeneratedMessageV3.Builder<TranslateDocumentResponse.Builder> implements TranslateDocumentResponseOrBuilder

A translated document response message.

Protobuf type google.cloud.translation.v3.TranslateDocumentResponse

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public TranslateDocumentResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides

build()

public TranslateDocumentResponse build()
Returns
Type Description
TranslateDocumentResponse

buildPartial()

public TranslateDocumentResponse buildPartial()
Returns
Type Description
TranslateDocumentResponse

clear()

public TranslateDocumentResponse.Builder clear()
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides

clearDocumentTranslation()

public TranslateDocumentResponse.Builder clearDocumentTranslation()

Translated document.

.google.cloud.translation.v3.DocumentTranslation document_translation = 1;

Returns
Type Description
TranslateDocumentResponse.Builder

clearField(Descriptors.FieldDescriptor field)

public TranslateDocumentResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides

clearGlossaryConfig()

public TranslateDocumentResponse.Builder clearGlossaryConfig()

The glossary_config used for this translation.

.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;

Returns
Type Description
TranslateDocumentResponse.Builder

clearGlossaryDocumentTranslation()

public TranslateDocumentResponse.Builder clearGlossaryDocumentTranslation()

The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply.

.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;

Returns
Type Description
TranslateDocumentResponse.Builder

clearModel()

public TranslateDocumentResponse.Builder clearModel()

Only present when 'model' is present in the request. 'model' is normalized to have a project number.

For example: If the 'model' field in TranslateDocumentRequest 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 = 3;

Returns
Type Description
TranslateDocumentResponse.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public TranslateDocumentResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides

clone()

public TranslateDocumentResponse.Builder clone()
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides

getDefaultInstanceForType()

public TranslateDocumentResponse getDefaultInstanceForType()
Returns
Type Description
TranslateDocumentResponse

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDocumentTranslation()

public DocumentTranslation getDocumentTranslation()

Translated document.

.google.cloud.translation.v3.DocumentTranslation document_translation = 1;

Returns
Type Description
DocumentTranslation

The documentTranslation.

getDocumentTranslationBuilder()

public DocumentTranslation.Builder getDocumentTranslationBuilder()

Translated document.

.google.cloud.translation.v3.DocumentTranslation document_translation = 1;

Returns
Type Description
DocumentTranslation.Builder

getDocumentTranslationOrBuilder()

public DocumentTranslationOrBuilder getDocumentTranslationOrBuilder()

Translated document.

.google.cloud.translation.v3.DocumentTranslation document_translation = 1;

Returns
Type Description
DocumentTranslationOrBuilder

getGlossaryConfig()

public TranslateTextGlossaryConfig getGlossaryConfig()

The glossary_config used for this translation.

.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;

Returns
Type Description
TranslateTextGlossaryConfig

The glossaryConfig.

getGlossaryConfigBuilder()

public TranslateTextGlossaryConfig.Builder getGlossaryConfigBuilder()

The glossary_config used for this translation.

.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;

Returns
Type Description
TranslateTextGlossaryConfig.Builder

getGlossaryConfigOrBuilder()

public TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder()

The glossary_config used for this translation.

.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;

Returns
Type Description
TranslateTextGlossaryConfigOrBuilder

getGlossaryDocumentTranslation()

public DocumentTranslation getGlossaryDocumentTranslation()

The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply.

.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;

Returns
Type Description
DocumentTranslation

The glossaryDocumentTranslation.

getGlossaryDocumentTranslationBuilder()

public DocumentTranslation.Builder getGlossaryDocumentTranslationBuilder()

The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply.

.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;

Returns
Type Description
DocumentTranslation.Builder

getGlossaryDocumentTranslationOrBuilder()

public DocumentTranslationOrBuilder getGlossaryDocumentTranslationOrBuilder()

The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply.

.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;

Returns
Type Description
DocumentTranslationOrBuilder

getModel()

public String getModel()

Only present when 'model' is present in the request. 'model' is normalized to have a project number.

For example: If the 'model' field in TranslateDocumentRequest 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 = 3;

Returns
Type Description
String

The model.

getModelBytes()

public ByteString getModelBytes()

Only present when 'model' is present in the request. 'model' is normalized to have a project number.

For example: If the 'model' field in TranslateDocumentRequest 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 = 3;

Returns
Type Description
ByteString

The bytes for model.

hasDocumentTranslation()

public boolean hasDocumentTranslation()

Translated document.

.google.cloud.translation.v3.DocumentTranslation document_translation = 1;

Returns
Type Description
boolean

Whether the documentTranslation field is set.

hasGlossaryConfig()

public boolean hasGlossaryConfig()

The glossary_config used for this translation.

.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;

Returns
Type Description
boolean

Whether the glossaryConfig field is set.

hasGlossaryDocumentTranslation()

public boolean hasGlossaryDocumentTranslation()

The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply.

.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;

Returns
Type Description
boolean

Whether the glossaryDocumentTranslation field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeDocumentTranslation(DocumentTranslation value)

public TranslateDocumentResponse.Builder mergeDocumentTranslation(DocumentTranslation value)

Translated document.

.google.cloud.translation.v3.DocumentTranslation document_translation = 1;

Parameter
Name Description
value DocumentTranslation
Returns
Type Description
TranslateDocumentResponse.Builder

mergeFrom(TranslateDocumentResponse other)

public TranslateDocumentResponse.Builder mergeFrom(TranslateDocumentResponse other)
Parameter
Name Description
other TranslateDocumentResponse
Returns
Type Description
TranslateDocumentResponse.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public TranslateDocumentResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public TranslateDocumentResponse.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides

mergeGlossaryConfig(TranslateTextGlossaryConfig value)

public TranslateDocumentResponse.Builder mergeGlossaryConfig(TranslateTextGlossaryConfig value)

The glossary_config used for this translation.

.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;

Parameter
Name Description
value TranslateTextGlossaryConfig
Returns
Type Description
TranslateDocumentResponse.Builder

mergeGlossaryDocumentTranslation(DocumentTranslation value)

public TranslateDocumentResponse.Builder mergeGlossaryDocumentTranslation(DocumentTranslation value)

The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply.

.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;

Parameter
Name Description
value DocumentTranslation
Returns
Type Description
TranslateDocumentResponse.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final TranslateDocumentResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides

setDocumentTranslation(DocumentTranslation value)

public TranslateDocumentResponse.Builder setDocumentTranslation(DocumentTranslation value)

Translated document.

.google.cloud.translation.v3.DocumentTranslation document_translation = 1;

Parameter
Name Description
value DocumentTranslation
Returns
Type Description
TranslateDocumentResponse.Builder

setDocumentTranslation(DocumentTranslation.Builder builderForValue)

public TranslateDocumentResponse.Builder setDocumentTranslation(DocumentTranslation.Builder builderForValue)

Translated document.

.google.cloud.translation.v3.DocumentTranslation document_translation = 1;

Parameter
Name Description
builderForValue DocumentTranslation.Builder
Returns
Type Description
TranslateDocumentResponse.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public TranslateDocumentResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides

setGlossaryConfig(TranslateTextGlossaryConfig value)

public TranslateDocumentResponse.Builder setGlossaryConfig(TranslateTextGlossaryConfig value)

The glossary_config used for this translation.

.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;

Parameter
Name Description
value TranslateTextGlossaryConfig
Returns
Type Description
TranslateDocumentResponse.Builder

setGlossaryConfig(TranslateTextGlossaryConfig.Builder builderForValue)

public TranslateDocumentResponse.Builder setGlossaryConfig(TranslateTextGlossaryConfig.Builder builderForValue)

The glossary_config used for this translation.

.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;

Parameter
Name Description
builderForValue TranslateTextGlossaryConfig.Builder
Returns
Type Description
TranslateDocumentResponse.Builder

setGlossaryDocumentTranslation(DocumentTranslation value)

public TranslateDocumentResponse.Builder setGlossaryDocumentTranslation(DocumentTranslation value)

The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply.

.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;

Parameter
Name Description
value DocumentTranslation
Returns
Type Description
TranslateDocumentResponse.Builder

setGlossaryDocumentTranslation(DocumentTranslation.Builder builderForValue)

public TranslateDocumentResponse.Builder setGlossaryDocumentTranslation(DocumentTranslation.Builder builderForValue)

The document's translation output if a glossary is provided in the request. This can be the same as [TranslateDocumentResponse.document_translation] if no glossary terms apply.

.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;

Parameter
Name Description
builderForValue DocumentTranslation.Builder
Returns
Type Description
TranslateDocumentResponse.Builder

setModel(String value)

public TranslateDocumentResponse.Builder setModel(String value)

Only present when 'model' is present in the request. 'model' is normalized to have a project number.

For example: If the 'model' field in TranslateDocumentRequest 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 = 3;

Parameter
Name Description
value String

The model to set.

Returns
Type Description
TranslateDocumentResponse.Builder

This builder for chaining.

setModelBytes(ByteString value)

public TranslateDocumentResponse.Builder setModelBytes(ByteString value)

Only present when 'model' is present in the request. 'model' is normalized to have a project number.

For example: If the 'model' field in TranslateDocumentRequest 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 = 3;

Parameter
Name Description
value ByteString

The bytes for model to set.

Returns
Type Description
TranslateDocumentResponse.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public TranslateDocumentResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final TranslateDocumentResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TranslateDocumentResponse.Builder
Overrides