Class Document.Builder (2.5.0)

publicstaticfinalclass Document.BuilderextendsGeneratedMessageV3.Builder<Document.Builder>implementsDocumentOrBuilder

Represents the input to API methods.

Protobuf type google.cloud.language.v1.Document

Implements

DocumentOrBuilder

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicDocument.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
value Object
Returns
Type Description
Overrides

build()

publicDocumentbuild()
Returns
Type Description

buildPartial()

publicDocumentbuildPartial()
Returns
Type Description

clear()

publicDocument.Builderclear()
Returns
Type Description
Overrides

clearContent()

publicDocument.BuilderclearContent()

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)

publicDocument.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
Returns
Type Description
Overrides

clearGcsContentUri()

publicDocument.BuilderclearGcsContentUri()

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.

clearLanguage()

publicDocument.BuilderclearLanguage()

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 = 4;

Returns
Type Description
Document.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

publicDocument.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
Returns
Type Description
Overrides

clearSource()

publicDocument.BuilderclearSource()
Returns
Type Description

clearType()

publicDocument.BuilderclearType()

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

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

Returns
Type Description
Document.Builder

This builder for chaining.

clone()

publicDocument.Builderclone()
Returns
Type Description
Overrides

getContent()

publicStringgetContent()

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()

publicByteStringgetContentBytes()

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()

publicDocumentgetDefaultInstanceForType()
Returns
Type Description

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Overrides

getGcsContentUri()

publicStringgetGcsContentUri()

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()

publicByteStringgetGcsContentUriBytes()

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.

getLanguage()

publicStringgetLanguage()

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 = 4;

Returns
Type Description
String

The language.

getLanguageBytes()

publicByteStringgetLanguageBytes()

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 = 4;

Returns
Type Description
ByteString

The bytes for language.

getSourceCase()

publicDocument.SourceCasegetSourceCase()
Returns
Type Description

getType()

publicDocument.TypegetType()

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

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

Returns
Type Description
Document.Type

The type.

getTypeValue()

publicintgetTypeValue()

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

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

Returns
Type Description
int

The enum numeric value on the wire for type.

hasContent()

publicbooleanhasContent()

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()

publicbooleanhasGcsContentUri()

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()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
Overrides

mergeFrom(Document other)

publicDocument.BuildermergeFrom(Documentother)
Parameter
Name Description
other Document
Returns
Type Description

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicDocument.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Overrides Exceptions
Type Description

mergeFrom(Message other)

publicDocument.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalDocument.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Overrides

setContent(String value)

publicDocument.BuildersetContent(Stringvalue)

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)

publicDocument.BuildersetContentBytes(ByteStringvalue)

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)

publicDocument.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
value Object
Returns
Type Description
Overrides

setGcsContentUri(String value)

publicDocument.BuildersetGcsContentUri(Stringvalue)

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)

publicDocument.BuildersetGcsContentUriBytes(ByteStringvalue)

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.

setLanguage(String value)

publicDocument.BuildersetLanguage(Stringvalue)

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 = 4;

Parameter
Name Description
value String

The language to set.

Returns
Type Description
Document.Builder

This builder for chaining.

setLanguageBytes(ByteString value)

publicDocument.BuildersetLanguageBytes(ByteStringvalue)

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 = 4;

Parameter
Name Description
value ByteString

The bytes for language to set.

Returns
Type Description
Document.Builder

This builder for chaining.

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

publicDocument.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
index int
value Object
Returns
Type Description
Overrides

setType(Document.Type value)

publicDocument.BuildersetType(Document.Typevalue)

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

.google.cloud.language.v1.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)

publicDocument.BuildersetTypeValue(intvalue)

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

.google.cloud.language.v1.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)

publicfinalDocument.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.