Class Document (2.33.0)

publicfinalclass DocumentextendsGeneratedMessageV3implementsDocumentOrBuilder

Represents the input to API methods.

Protobuf type google.cloud.language.v1.Document

Implements

DocumentOrBuilder

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

CONTENT_FIELD_NUMBER

publicstaticfinalintCONTENT_FIELD_NUMBER
Field Value
Type Description
int

GCS_CONTENT_URI_FIELD_NUMBER

publicstaticfinalintGCS_CONTENT_URI_FIELD_NUMBER
Field Value
Type Description
int

LANGUAGE_FIELD_NUMBER

publicstaticfinalintLANGUAGE_FIELD_NUMBER
Field Value
Type Description
int

TYPE_FIELD_NUMBER

publicstaticfinalintTYPE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticDocumentgetDefaultInstance()
Returns
Type Description
Document

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticDocument.BuildernewBuilder()
Returns
Type Description
Document.Builder

newBuilder(Document prototype)

publicstaticDocument.BuildernewBuilder(Documentprototype)
Parameter
Name Description
prototype Document
Returns
Type Description
Document.Builder

parseDelimitedFrom(InputStream input)

publicstaticDocumentparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Document
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticDocumentparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Document
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticDocumentparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Document
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticDocumentparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Document
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticDocumentparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Document
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticDocumentparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Document
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticDocumentparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Document
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticDocumentparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Document
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticDocumentparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Document
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticDocumentparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Document
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticDocumentparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Document
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticDocumentparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Document
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<Document>parser()
Returns
Type Description
Parser<Document>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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
Document

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.

getParserForType()

publicParser<Document>getParserForType()
Returns
Type Description
Parser<Document>
Overrides

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getSourceCase()

publicDocument.SourceCasegetSourceCase()
Returns
Type Description
Document.SourceCase

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.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicDocument.BuildernewBuilderForType()
Returns
Type Description
Document.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedDocument.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Document.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicDocument.BuildertoBuilder()
Returns
Type Description
Document.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

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.