Class DetectLanguageRequest.Builder (2.3.2)

public static final class DetectLanguageRequest.Builder extends GeneratedMessageV3.Builder<DetectLanguageRequest.Builder> implements DetectLanguageRequestOrBuilder

The request message for language detection.

Protobuf type google.cloud.translation.v3beta1.DetectLanguageRequest

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public DetectLanguageRequest build()
Returns
TypeDescription
DetectLanguageRequest

buildPartial()

public DetectLanguageRequest buildPartial()
Returns
TypeDescription
DetectLanguageRequest

clear()

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

clearContent()

public DetectLanguageRequest.Builder clearContent()

The content of the input stored as a string.

string content = 1;

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearLabels()

public DetectLanguageRequest.Builder clearLabels()
Returns
TypeDescription
DetectLanguageRequest.Builder

clearMimeType()

public DetectLanguageRequest.Builder clearMimeType()

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

clearModel()

public DetectLanguageRequest.Builder clearModel()

Optional. The language detection model to be used. Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id} Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default. If not specified, the default model is used.

string model = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearParent()

public DetectLanguageRequest.Builder clearParent()

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

clearSource()

public DetectLanguageRequest.Builder clearSource()
Returns
TypeDescription
DetectLanguageRequest.Builder

clone()

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

containsLabels(String key)

public boolean containsLabels(String key)

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getContent()

public String getContent()

The content of the input stored as a string.

string content = 1;

Returns
TypeDescription
String

The content.

getContentBytes()

public ByteString getContentBytes()

The content of the input stored as a string.

string content = 1;

Returns
TypeDescription
ByteString

The bytes for content.

getDefaultInstanceForType()

public DetectLanguageRequest getDefaultInstanceForType()
Returns
TypeDescription
DetectLanguageRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMimeType()

public String getMimeType()

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
String

The mimeType.

getMimeTypeBytes()

public ByteString getMimeTypeBytes()

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ByteString

The bytes for mimeType.

getModel()

public String getModel()

Optional. The language detection model to be used. Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id} Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default. If not specified, the default model is used.

string model = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
String

The model.

getModelBytes()

public ByteString getModelBytes()

Optional. The language detection model to be used. Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id} Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default. If not specified, the default model is used.

string model = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ByteString

The bytes for model.

getMutableLabels()

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getParent()

public String getParent()

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The parent.

getParentBytes()

public ByteString getParentBytes()

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for parent.

getSourceCase()

public DetectLanguageRequest.SourceCase getSourceCase()
Returns
TypeDescription
DetectLanguageRequest.SourceCase

hasContent()

public boolean hasContent()

The content of the input stored as a string.

string content = 1;

Returns
TypeDescription
boolean

Whether the content field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(DetectLanguageRequest other)

public DetectLanguageRequest.Builder mergeFrom(DetectLanguageRequest other)
Parameter
NameDescription
otherDetectLanguageRequest
Returns
TypeDescription
DetectLanguageRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllLabels(Map<String,String> values)

public DetectLanguageRequest.Builder putAllLabels(Map<String,String> values)

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
DetectLanguageRequest.Builder

putLabels(String key, String value)

public DetectLanguageRequest.Builder putLabels(String key, String value)

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
DetectLanguageRequest.Builder

removeLabels(String key)

public DetectLanguageRequest.Builder removeLabels(String key)

Optional. The labels with user-defined metadata for the request. Label keys and values can be no longer than 63 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter. See https://cloud.google.com/translate/docs/labels for more information.

map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
keyString
Returns
TypeDescription
DetectLanguageRequest.Builder

setContent(String value)

public DetectLanguageRequest.Builder setContent(String value)

The content of the input stored as a string.

string content = 1;

Parameter
NameDescription
valueString

The content to set.

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

setContentBytes(ByteString value)

public DetectLanguageRequest.Builder setContentBytes(ByteString value)

The content of the input stored as a string.

string content = 1;

Parameter
NameDescription
valueByteString

The bytes for content to set.

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setMimeType(String value)

public DetectLanguageRequest.Builder setMimeType(String value)

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueString

The mimeType to set.

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

setMimeTypeBytes(ByteString value)

public DetectLanguageRequest.Builder setMimeTypeBytes(ByteString value)

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

string mime_type = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueByteString

The bytes for mimeType to set.

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

setModel(String value)

public DetectLanguageRequest.Builder setModel(String value)

Optional. The language detection model to be used. Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id} Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default. If not specified, the default model is used.

string model = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueString

The model to set.

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

setModelBytes(ByteString value)

public DetectLanguageRequest.Builder setModelBytes(ByteString value)

Optional. The language detection model to be used. Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id} Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default. If not specified, the default model is used.

string model = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
valueByteString

The bytes for model to set.

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

setParent(String value)

public DetectLanguageRequest.Builder setParent(String value)

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The parent to set.

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

setParentBytes(ByteString value)

public DetectLanguageRequest.Builder setParentBytes(ByteString value)

Required. Project or location to make a call. Must refer to a caller's project. Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}. For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

string parent = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for parent to set.

Returns
TypeDescription
DetectLanguageRequest.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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