Class Document.Builder (2.49.0)

public static final class Document.Builder extends GeneratedMessageV3.Builder<Document.Builder> implements DocumentOrBuilder

Represents the input to API methods.

Protobuf type google.cloud.language.v2.Document

Implements

DocumentOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Document build()
Returns
Type Description
Document

buildPartial()

public Document buildPartial()
Returns
Type Description
Document

clear()

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

clearContent()

public Document.Builder clearContent()

The content of the input in string format. Cloud audit logging exempt since it is based on user data.

string content = 2;

Returns
Type Description
Document.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearGcsContentUri()

public Document.Builder clearGcsContentUri()

The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.

string gcs_content_uri = 3;

Returns
Type Description
Document.Builder

This builder for chaining.

clearLanguageCode()

public Document.Builder clearLanguageCode()

Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.<br> Language Support lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an INVALID_ARGUMENT error is returned.

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

Returns
Type Description
Document.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearSource()

public Document.Builder clearSource()
Returns
Type Description
Document.Builder

clearType()

public Document.Builder clearType()

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

.google.cloud.language.v2.Document.Type type = 1;

Returns
Type Description
Document.Builder

This builder for chaining.

clone()

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

getContent()

public String getContent()

The content of the input in string format. Cloud audit logging exempt since it is based on user data.

string content = 2;

Returns
Type Description
String

The content.

getContentBytes()

public ByteString getContentBytes()

The content of the input in string format. Cloud audit logging exempt since it is based on user data.

string content = 2;

Returns
Type Description
ByteString

The bytes for content.

getDefaultInstanceForType()

public Document getDefaultInstanceForType()
Returns
Type Description
Document

getDescriptorForType()

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

getGcsContentUri()

public String getGcsContentUri()

The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.

string gcs_content_uri = 3;

Returns
Type Description
String

The gcsContentUri.

getGcsContentUriBytes()

public ByteString getGcsContentUriBytes()

The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.

string gcs_content_uri = 3;

Returns
Type Description
ByteString

The bytes for gcsContentUri.

getLanguageCode()

public String getLanguageCode()

Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.<br> Language Support lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an INVALID_ARGUMENT error is returned.

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

Returns
Type Description
String

The languageCode.

getLanguageCodeBytes()

public ByteString getLanguageCodeBytes()

Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.<br> Language Support lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an INVALID_ARGUMENT error is returned.

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

Returns
Type Description
ByteString

The bytes for languageCode.

getSourceCase()

public Document.SourceCase getSourceCase()
Returns
Type Description
Document.SourceCase

getType()

public Document.Type getType()

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

.google.cloud.language.v2.Document.Type type = 1;

Returns
Type Description
Document.Type

The type.

getTypeValue()

public int getTypeValue()

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

.google.cloud.language.v2.Document.Type type = 1;

Returns
Type Description
int

The enum numeric value on the wire for type.

hasContent()

public boolean hasContent()

The content of the input in string format. Cloud audit logging exempt since it is based on user data.

string content = 2;

Returns
Type Description
boolean

Whether the content field is set.

hasGcsContentUri()

public boolean hasGcsContentUri()

The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.

string gcs_content_uri = 3;

Returns
Type Description
boolean

Whether the gcsContentUri field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Document other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setContent(String value)

public Document.Builder setContent(String value)

The content of the input in string format. Cloud audit logging exempt since it is based on user data.

string content = 2;

Parameter
Name Description
value String

The content to set.

Returns
Type Description
Document.Builder

This builder for chaining.

setContentBytes(ByteString value)

public Document.Builder setContentBytes(ByteString value)

The content of the input in string format. Cloud audit logging exempt since it is based on user data.

string content = 2;

Parameter
Name Description
value ByteString

The bytes for content to set.

Returns
Type Description
Document.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setGcsContentUri(String value)

public Document.Builder setGcsContentUri(String value)

The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.

string gcs_content_uri = 3;

Parameter
Name Description
value String

The gcsContentUri to set.

Returns
Type Description
Document.Builder

This builder for chaining.

setGcsContentUriBytes(ByteString value)

public Document.Builder setGcsContentUriBytes(ByteString value)

The Google Cloud Storage URI where the file content is located. This URI must be of the form: gs://bucket_name/object_name. For more details, see https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object versioning is not supported.

string gcs_content_uri = 3;

Parameter
Name Description
value ByteString

The bytes for gcsContentUri to set.

Returns
Type Description
Document.Builder

This builder for chaining.

setLanguageCode(String value)

public Document.Builder setLanguageCode(String value)

Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.<br> Language Support lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an INVALID_ARGUMENT error is returned.

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

Parameter
Name Description
value String

The languageCode to set.

Returns
Type Description
Document.Builder

This builder for chaining.

setLanguageCodeBytes(ByteString value)

public Document.Builder setLanguageCodeBytes(ByteString value)

Optional. The language of the document (if not specified, the language is automatically detected). Both ISO and BCP-47 language codes are accepted.<br> Language Support lists currently supported languages for each API method. If the language (either specified by the caller or automatically detected) is not supported by the called API method, an INVALID_ARGUMENT error is returned.

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

Parameter
Name Description
value ByteString

The bytes for languageCode to set.

Returns
Type Description
Document.Builder

This builder for chaining.

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

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

setType(Document.Type value)

public Document.Builder setType(Document.Type value)

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

.google.cloud.language.v2.Document.Type type = 1;

Parameter
Name Description
value Document.Type

The type to set.

Returns
Type Description
Document.Builder

This builder for chaining.

setTypeValue(int value)

public Document.Builder setTypeValue(int value)

Required. If the type is not set or is TYPE_UNSPECIFIED, returns an INVALID_ARGUMENT error.

.google.cloud.language.v2.Document.Type type = 1;

Parameter
Name Description
value int

The enum numeric value on the wire for type to set.

Returns
Type Description
Document.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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