Class TranslateDocumentResponse.Builder (2.6.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public TranslateDocumentResponse build()
Returns
TypeDescription
TranslateDocumentResponse

buildPartial()

public TranslateDocumentResponse buildPartial()
Returns
TypeDescription
TranslateDocumentResponse

clear()

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

clearDocumentTranslation()

public TranslateDocumentResponse.Builder clearDocumentTranslation()

Translated document.

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

Returns
TypeDescription
TranslateDocumentResponse.Builder

clearField(Descriptors.FieldDescriptor field)

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

clearGlossaryConfig()

public TranslateDocumentResponse.Builder clearGlossaryConfig()

The glossary_config used for this translation.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
TranslateDocumentResponse.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getDefaultInstanceForType()

public TranslateDocumentResponse getDefaultInstanceForType()
Returns
TypeDescription
TranslateDocumentResponse

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDocumentTranslation()

public DocumentTranslation getDocumentTranslation()

Translated document.

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

Returns
TypeDescription
DocumentTranslation

The documentTranslation.

getDocumentTranslationBuilder()

public DocumentTranslation.Builder getDocumentTranslationBuilder()

Translated document.

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

Returns
TypeDescription
DocumentTranslation.Builder

getDocumentTranslationOrBuilder()

public DocumentTranslationOrBuilder getDocumentTranslationOrBuilder()

Translated document.

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

Returns
TypeDescription
DocumentTranslationOrBuilder

getGlossaryConfig()

public TranslateTextGlossaryConfig getGlossaryConfig()

The glossary_config used for this translation.

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

Returns
TypeDescription
TranslateTextGlossaryConfig

The glossaryConfig.

getGlossaryConfigBuilder()

public TranslateTextGlossaryConfig.Builder getGlossaryConfigBuilder()

The glossary_config used for this translation.

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

Returns
TypeDescription
TranslateTextGlossaryConfig.Builder

getGlossaryConfigOrBuilder()

public TranslateTextGlossaryConfigOrBuilder getGlossaryConfigOrBuilder()

The glossary_config used for this translation.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for model.

hasDocumentTranslation()

public boolean hasDocumentTranslation()

Translated document.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the glossaryDocumentTranslation field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeDocumentTranslation(DocumentTranslation value)

public TranslateDocumentResponse.Builder mergeDocumentTranslation(DocumentTranslation value)

Translated document.

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

Parameter
NameDescription
valueDocumentTranslation
Returns
TypeDescription
TranslateDocumentResponse.Builder

mergeFrom(TranslateDocumentResponse other)

public TranslateDocumentResponse.Builder mergeFrom(TranslateDocumentResponse other)
Parameter
NameDescription
otherTranslateDocumentResponse
Returns
TypeDescription
TranslateDocumentResponse.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public TranslateDocumentResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TranslateDocumentResponse.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public TranslateDocumentResponse.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueTranslateTextGlossaryConfig
Returns
TypeDescription
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
NameDescription
valueDocumentTranslation
Returns
TypeDescription
TranslateDocumentResponse.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final TranslateDocumentResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
TranslateDocumentResponse.Builder
Overrides

setDocumentTranslation(DocumentTranslation value)

public TranslateDocumentResponse.Builder setDocumentTranslation(DocumentTranslation value)

Translated document.

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

Parameter
NameDescription
valueDocumentTranslation
Returns
TypeDescription
TranslateDocumentResponse.Builder

setDocumentTranslation(DocumentTranslation.Builder builderForValue)

public TranslateDocumentResponse.Builder setDocumentTranslation(DocumentTranslation.Builder builderForValue)

Translated document.

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

Parameter
NameDescription
builderForValueDocumentTranslation.Builder
Returns
TypeDescription
TranslateDocumentResponse.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public TranslateDocumentResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueTranslateTextGlossaryConfig
Returns
TypeDescription
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
NameDescription
builderForValueTranslateTextGlossaryConfig.Builder
Returns
TypeDescription
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
NameDescription
valueDocumentTranslation
Returns
TypeDescription
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
NameDescription
builderForValueDocumentTranslation.Builder
Returns
TypeDescription
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
NameDescription
valueString

The model to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for model to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
TranslateDocumentResponse.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final TranslateDocumentResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
TranslateDocumentResponse.Builder
Overrides