Class DocumentTranslation.Builder (2.7.0)

public static final class DocumentTranslation.Builder extends GeneratedMessageV3.Builder<DocumentTranslation.Builder> implements DocumentTranslationOrBuilder

A translated document message.

Protobuf type google.cloud.translation.v3beta1.DocumentTranslation

Static Methods

getDescriptor()

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

Methods

addAllByteStreamOutputs(Iterable<? extends ByteString> values)

public DocumentTranslation.Builder addAllByteStreamOutputs(Iterable<? extends ByteString> values)

The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats.

repeated bytes byte_stream_outputs = 1;

Parameter
NameDescription
valuesIterable<? extends com.google.protobuf.ByteString>

The byteStreamOutputs to add.

Returns
TypeDescription
DocumentTranslation.Builder

This builder for chaining.

addByteStreamOutputs(ByteString value)

public DocumentTranslation.Builder addByteStreamOutputs(ByteString value)

The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats.

repeated bytes byte_stream_outputs = 1;

Parameter
NameDescription
valueByteString

The byteStreamOutputs to add.

Returns
TypeDescription
DocumentTranslation.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public DocumentTranslation build()
Returns
TypeDescription
DocumentTranslation

buildPartial()

public DocumentTranslation buildPartial()
Returns
TypeDescription
DocumentTranslation

clear()

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

clearByteStreamOutputs()

public DocumentTranslation.Builder clearByteStreamOutputs()

The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats.

repeated bytes byte_stream_outputs = 1;

Returns
TypeDescription
DocumentTranslation.Builder

This builder for chaining.

clearDetectedLanguageCode()

public DocumentTranslation.Builder clearDetectedLanguageCode()

The detected language for the input document. If the user did not provide the source language for the input document, this field will have the language code automatically detected. If the source language was passed, auto-detection of the language does not occur and this field is empty.

string detected_language_code = 3;

Returns
TypeDescription
DocumentTranslation.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearMimeType()

public DocumentTranslation.Builder clearMimeType()

The translated document's mime type.

string mime_type = 2;

Returns
TypeDescription
DocumentTranslation.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getByteStreamOutputs(int index)

public ByteString getByteStreamOutputs(int index)

The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats.

repeated bytes byte_stream_outputs = 1;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
ByteString

The byteStreamOutputs at the given index.

getByteStreamOutputsCount()

public int getByteStreamOutputsCount()

The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats.

repeated bytes byte_stream_outputs = 1;

Returns
TypeDescription
int

The count of byteStreamOutputs.

getByteStreamOutputsList()

public List<ByteString> getByteStreamOutputsList()

The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats.

repeated bytes byte_stream_outputs = 1;

Returns
TypeDescription
List<ByteString>

A list containing the byteStreamOutputs.

getDefaultInstanceForType()

public DocumentTranslation getDefaultInstanceForType()
Returns
TypeDescription
DocumentTranslation

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDetectedLanguageCode()

public String getDetectedLanguageCode()

The detected language for the input document. If the user did not provide the source language for the input document, this field will have the language code automatically detected. If the source language was passed, auto-detection of the language does not occur and this field is empty.

string detected_language_code = 3;

Returns
TypeDescription
String

The detectedLanguageCode.

getDetectedLanguageCodeBytes()

public ByteString getDetectedLanguageCodeBytes()

The detected language for the input document. If the user did not provide the source language for the input document, this field will have the language code automatically detected. If the source language was passed, auto-detection of the language does not occur and this field is empty.

string detected_language_code = 3;

Returns
TypeDescription
ByteString

The bytes for detectedLanguageCode.

getMimeType()

public String getMimeType()

The translated document's mime type.

string mime_type = 2;

Returns
TypeDescription
String

The mimeType.

getMimeTypeBytes()

public ByteString getMimeTypeBytes()

The translated document's mime type.

string mime_type = 2;

Returns
TypeDescription
ByteString

The bytes for mimeType.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(DocumentTranslation other)

public DocumentTranslation.Builder mergeFrom(DocumentTranslation other)
Parameter
NameDescription
otherDocumentTranslation
Returns
TypeDescription
DocumentTranslation.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public DocumentTranslation.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
DocumentTranslation.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setByteStreamOutputs(int index, ByteString value)

public DocumentTranslation.Builder setByteStreamOutputs(int index, ByteString value)

The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats.

repeated bytes byte_stream_outputs = 1;

Parameters
NameDescription
indexint

The index to set the value at.

valueByteString

The byteStreamOutputs to set.

Returns
TypeDescription
DocumentTranslation.Builder

This builder for chaining.

setDetectedLanguageCode(String value)

public DocumentTranslation.Builder setDetectedLanguageCode(String value)

The detected language for the input document. If the user did not provide the source language for the input document, this field will have the language code automatically detected. If the source language was passed, auto-detection of the language does not occur and this field is empty.

string detected_language_code = 3;

Parameter
NameDescription
valueString

The detectedLanguageCode to set.

Returns
TypeDescription
DocumentTranslation.Builder

This builder for chaining.

setDetectedLanguageCodeBytes(ByteString value)

public DocumentTranslation.Builder setDetectedLanguageCodeBytes(ByteString value)

The detected language for the input document. If the user did not provide the source language for the input document, this field will have the language code automatically detected. If the source language was passed, auto-detection of the language does not occur and this field is empty.

string detected_language_code = 3;

Parameter
NameDescription
valueByteString

The bytes for detectedLanguageCode to set.

Returns
TypeDescription
DocumentTranslation.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setMimeType(String value)

public DocumentTranslation.Builder setMimeType(String value)

The translated document's mime type.

string mime_type = 2;

Parameter
NameDescription
valueString

The mimeType to set.

Returns
TypeDescription
DocumentTranslation.Builder

This builder for chaining.

setMimeTypeBytes(ByteString value)

public DocumentTranslation.Builder setMimeTypeBytes(ByteString value)

The translated document's mime type.

string mime_type = 2;

Parameter
NameDescription
valueByteString

The bytes for mimeType to set.

Returns
TypeDescription
DocumentTranslation.Builder

This builder for chaining.

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

public DocumentTranslation.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
DocumentTranslation.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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