public final class Document extends GeneratedMessageV3 implements DocumentOrBuilder
Document represents the canonical document resource in Document Understanding
AI.
It is an interchange format that provides insights into documents and allows
for collaboration between users and Document Understanding AI to iterate and
optimize for quality.
Protobuf type google.cloud.documentai.v1beta1.Document
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>)
Static Fields
CONTENT_FIELD_NUMBER
public static final int CONTENT_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
ENTITIES_FIELD_NUMBER
public static final int ENTITIES_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
ENTITY_RELATIONS_FIELD_NUMBER
public static final int ENTITY_RELATIONS_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
ERROR_FIELD_NUMBER
public static final int ERROR_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
MIME_TYPE_FIELD_NUMBER
public static final int MIME_TYPE_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
PAGES_FIELD_NUMBER
public static final int PAGES_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
SHARD_INFO_FIELD_NUMBER
public static final int SHARD_INFO_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
TEXT_FIELD_NUMBER
public static final int TEXT_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
TEXT_STYLES_FIELD_NUMBER
public static final int TEXT_STYLES_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
URI_FIELD_NUMBER
public static final int URI_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
Static Methods
getDefaultInstance()
public static Document getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static Document.Builder newBuilder()
newBuilder(Document prototype)
public static Document.Builder newBuilder(Document prototype)
Parameter |
---|
Name | Description |
prototype | Document
|
public static Document parseDelimitedFrom(InputStream input)
public static Document parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static Document parseFrom(byte[] data)
Parameter |
---|
Name | Description |
data | byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Document parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static Document parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Document parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Document parseFrom(CodedInputStream input)
public static Document parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static Document parseFrom(InputStream input)
public static Document parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static Document parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Document parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<Document> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
---|
Name | Description |
obj | Object
|
Overrides
getContent()
public ByteString getContent()
Inline document content, represented as a stream of bytes.
Note: As with all bytes
fields, protobuffers use a pure binary
representation, whereas JSON representations use base64.
bytes content = 2;
getDefaultInstanceForType()
public Document getDefaultInstanceForType()
getEntities(int index)
public Document.Entity getEntities(int index)
A list of entities detected on
Document.text. For
document shards, entities in this list may cross shard boundaries.
repeated .google.cloud.documentai.v1beta1.Document.Entity entities = 7;
Parameter |
---|
Name | Description |
index | int
|
getEntitiesCount()
public int getEntitiesCount()
A list of entities detected on
Document.text. For
document shards, entities in this list may cross shard boundaries.
repeated .google.cloud.documentai.v1beta1.Document.Entity entities = 7;
Returns |
---|
Type | Description |
int | |
getEntitiesList()
public List<Document.Entity> getEntitiesList()
A list of entities detected on
Document.text. For
document shards, entities in this list may cross shard boundaries.
repeated .google.cloud.documentai.v1beta1.Document.Entity entities = 7;
getEntitiesOrBuilder(int index)
public Document.EntityOrBuilder getEntitiesOrBuilder(int index)
A list of entities detected on
Document.text. For
document shards, entities in this list may cross shard boundaries.
repeated .google.cloud.documentai.v1beta1.Document.Entity entities = 7;
Parameter |
---|
Name | Description |
index | int
|
getEntitiesOrBuilderList()
public List<? extends Document.EntityOrBuilder> getEntitiesOrBuilderList()
A list of entities detected on
Document.text. For
document shards, entities in this list may cross shard boundaries.
repeated .google.cloud.documentai.v1beta1.Document.Entity entities = 7;
Returns |
---|
Type | Description |
List<? extends com.google.cloud.documentai.v1beta1.Document.EntityOrBuilder> | |
getEntityRelations(int index)
public Document.EntityRelation getEntityRelations(int index)
Relationship among
Document.entities.
repeated .google.cloud.documentai.v1beta1.Document.EntityRelation entity_relations = 8;
Parameter |
---|
Name | Description |
index | int
|
getEntityRelationsCount()
public int getEntityRelationsCount()
Relationship among
Document.entities.
repeated .google.cloud.documentai.v1beta1.Document.EntityRelation entity_relations = 8;
Returns |
---|
Type | Description |
int | |
getEntityRelationsList()
public List<Document.EntityRelation> getEntityRelationsList()
Relationship among
Document.entities.
repeated .google.cloud.documentai.v1beta1.Document.EntityRelation entity_relations = 8;
getEntityRelationsOrBuilder(int index)
public Document.EntityRelationOrBuilder getEntityRelationsOrBuilder(int index)
Relationship among
Document.entities.
repeated .google.cloud.documentai.v1beta1.Document.EntityRelation entity_relations = 8;
Parameter |
---|
Name | Description |
index | int
|
getEntityRelationsOrBuilderList()
public List<? extends Document.EntityRelationOrBuilder> getEntityRelationsOrBuilderList()
Relationship among
Document.entities.
repeated .google.cloud.documentai.v1beta1.Document.EntityRelation entity_relations = 8;
Returns |
---|
Type | Description |
List<? extends com.google.cloud.documentai.v1beta1.Document.EntityRelationOrBuilder> | |
getError()
Any error that occurred while processing this document.
.google.rpc.Status error = 10;
Returns |
---|
Type | Description |
com.google.rpc.Status | The error.
|
getErrorOrBuilder()
public StatusOrBuilder getErrorOrBuilder()
Any error that occurred while processing this document.
.google.rpc.Status error = 10;
Returns |
---|
Type | Description |
com.google.rpc.StatusOrBuilder | |
getMimeType()
public String getMimeType()
Returns |
---|
Type | Description |
String | The mimeType.
|
getMimeTypeBytes()
public ByteString getMimeTypeBytes()
Returns |
---|
Type | Description |
ByteString | The bytes for mimeType.
|
getPages(int index)
public Document.Page getPages(int index)
Visual page layout for the
Document.
repeated .google.cloud.documentai.v1beta1.Document.Page pages = 6;
Parameter |
---|
Name | Description |
index | int
|
getPagesCount()
public int getPagesCount()
Visual page layout for the
Document.
repeated .google.cloud.documentai.v1beta1.Document.Page pages = 6;
Returns |
---|
Type | Description |
int | |
getPagesList()
public List<Document.Page> getPagesList()
Visual page layout for the
Document.
repeated .google.cloud.documentai.v1beta1.Document.Page pages = 6;
getPagesOrBuilder(int index)
public Document.PageOrBuilder getPagesOrBuilder(int index)
Visual page layout for the
Document.
repeated .google.cloud.documentai.v1beta1.Document.Page pages = 6;
Parameter |
---|
Name | Description |
index | int
|
getPagesOrBuilderList()
public List<? extends Document.PageOrBuilder> getPagesOrBuilderList()
Visual page layout for the
Document.
repeated .google.cloud.documentai.v1beta1.Document.Page pages = 6;
Returns |
---|
Type | Description |
List<? extends com.google.cloud.documentai.v1beta1.Document.PageOrBuilder> | |
getParserForType()
public Parser<Document> getParserForType()
Overrides
getSerializedSize()
public int getSerializedSize()
Returns |
---|
Type | Description |
int | |
Overrides
getShardInfo()
public Document.ShardInfo getShardInfo()
Information about the sharding if this document is sharded part of a larger
document. If the document is not sharded, this message is not specified.
.google.cloud.documentai.v1beta1.Document.ShardInfo shard_info = 9;
getShardInfoOrBuilder()
public Document.ShardInfoOrBuilder getShardInfoOrBuilder()
Information about the sharding if this document is sharded part of a larger
document. If the document is not sharded, this message is not specified.
.google.cloud.documentai.v1beta1.Document.ShardInfo shard_info = 9;
getSourceCase()
public Document.SourceCase getSourceCase()
getText()
UTF-8 encoded text in reading order from the document.
string text = 4;
Returns |
---|
Type | Description |
String | The text.
|
getTextBytes()
public ByteString getTextBytes()
UTF-8 encoded text in reading order from the document.
string text = 4;
Returns |
---|
Type | Description |
ByteString | The bytes for text.
|
getTextStyles(int index)
public Document.Style getTextStyles(int index)
Styles for the
Document.text.
repeated .google.cloud.documentai.v1beta1.Document.Style text_styles = 5;
Parameter |
---|
Name | Description |
index | int
|
getTextStylesCount()
public int getTextStylesCount()
Styles for the
Document.text.
repeated .google.cloud.documentai.v1beta1.Document.Style text_styles = 5;
Returns |
---|
Type | Description |
int | |
getTextStylesList()
public List<Document.Style> getTextStylesList()
Styles for the
Document.text.
repeated .google.cloud.documentai.v1beta1.Document.Style text_styles = 5;
getTextStylesOrBuilder(int index)
public Document.StyleOrBuilder getTextStylesOrBuilder(int index)
Styles for the
Document.text.
repeated .google.cloud.documentai.v1beta1.Document.Style text_styles = 5;
Parameter |
---|
Name | Description |
index | int
|
getTextStylesOrBuilderList()
public List<? extends Document.StyleOrBuilder> getTextStylesOrBuilderList()
Styles for the
Document.text.
repeated .google.cloud.documentai.v1beta1.Document.Style text_styles = 5;
Returns |
---|
Type | Description |
List<? extends com.google.cloud.documentai.v1beta1.Document.StyleOrBuilder> | |
getUri()
Currently supports Google Cloud Storage URI of the form
gs://bucket_name/object_name
. Object versioning is not supported.
See Google Cloud Storage Request
URIs for more
info.
string uri = 1;
Returns |
---|
Type | Description |
String | The uri.
|
getUriBytes()
public ByteString getUriBytes()
Currently supports Google Cloud Storage URI of the form
gs://bucket_name/object_name
. Object versioning is not supported.
See Google Cloud Storage Request
URIs for more
info.
string uri = 1;
Returns |
---|
Type | Description |
ByteString | The bytes for uri.
|
hasContent()
public boolean hasContent()
Inline document content, represented as a stream of bytes.
Note: As with all bytes
fields, protobuffers use a pure binary
representation, whereas JSON representations use base64.
bytes content = 2;
Returns |
---|
Type | Description |
boolean | Whether the content field is set.
|
hasError()
public boolean hasError()
Any error that occurred while processing this document.
.google.rpc.Status error = 10;
Returns |
---|
Type | Description |
boolean | Whether the error field is set.
|
hasShardInfo()
public boolean hasShardInfo()
Information about the sharding if this document is sharded part of a larger
document. If the document is not sharded, this message is not specified.
.google.cloud.documentai.v1beta1.Document.ShardInfo shard_info = 9;
Returns |
---|
Type | Description |
boolean | Whether the shardInfo field is set.
|
hasUri()
Currently supports Google Cloud Storage URI of the form
gs://bucket_name/object_name
. Object versioning is not supported.
See Google Cloud Storage Request
URIs for more
info.
string uri = 1;
Returns |
---|
Type | Description |
boolean | Whether the uri field is set.
|
hashCode()
Returns |
---|
Type | Description |
int | |
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public Document.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Document.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Overrides
toBuilder()
public Document.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides