Class Document.Entity

  • All Implemented Interfaces:
    Document.EntityOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable
    Enclosing class:
    Document

    public static final class Document.Entity
    extends com.google.protobuf.GeneratedMessageV3
    implements Document.EntityOrBuilder
     An entity that could be a phrase in the text or a property that belongs to
     the document. It is a known entity type, such as a person, an organization,
     or location.
     
    Protobuf type google.cloud.documentai.v1beta2.Document.Entity
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • hasTextAnchor

        public boolean hasTextAnchor()
         Optional. Provenance of the entity.
         Text anchor indexing into the
         [Document.text][google.cloud.documentai.v1beta2.Document.text].
         
        .google.cloud.documentai.v1beta2.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        hasTextAnchor in interface Document.EntityOrBuilder
        Returns:
        Whether the textAnchor field is set.
      • getTextAnchor

        public Document.TextAnchor getTextAnchor()
         Optional. Provenance of the entity.
         Text anchor indexing into the
         [Document.text][google.cloud.documentai.v1beta2.Document.text].
         
        .google.cloud.documentai.v1beta2.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getTextAnchor in interface Document.EntityOrBuilder
        Returns:
        The textAnchor.
      • getTextAnchorOrBuilder

        public Document.TextAnchorOrBuilder getTextAnchorOrBuilder()
         Optional. Provenance of the entity.
         Text anchor indexing into the
         [Document.text][google.cloud.documentai.v1beta2.Document.text].
         
        .google.cloud.documentai.v1beta2.Document.TextAnchor text_anchor = 1 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getTextAnchorOrBuilder in interface Document.EntityOrBuilder
      • getType

        public String getType()
         Required. Entity type from a schema e.g. `Address`.
         
        string type = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getType in interface Document.EntityOrBuilder
        Returns:
        The type.
      • getTypeBytes

        public com.google.protobuf.ByteString getTypeBytes()
         Required. Entity type from a schema e.g. `Address`.
         
        string type = 2 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getTypeBytes in interface Document.EntityOrBuilder
        Returns:
        The bytes for type.
      • getMentionText

        public String getMentionText()
         Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`.
         
        string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getMentionText in interface Document.EntityOrBuilder
        Returns:
        The mentionText.
      • getMentionTextBytes

        public com.google.protobuf.ByteString getMentionTextBytes()
         Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`.
         
        string mention_text = 3 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getMentionTextBytes in interface Document.EntityOrBuilder
        Returns:
        The bytes for mentionText.
      • getMentionId

        public String getMentionId()
         Optional. Deprecated.  Use `id` field instead.
         
        string mention_id = 4 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getMentionId in interface Document.EntityOrBuilder
        Returns:
        The mentionId.
      • getMentionIdBytes

        public com.google.protobuf.ByteString getMentionIdBytes()
         Optional. Deprecated.  Use `id` field instead.
         
        string mention_id = 4 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getMentionIdBytes in interface Document.EntityOrBuilder
        Returns:
        The bytes for mentionId.
      • getConfidence

        public float getConfidence()
         Optional. Confidence of detected Schema entity. Range `[0, 1]`.
         
        float confidence = 5 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getConfidence in interface Document.EntityOrBuilder
        Returns:
        The confidence.
      • hasPageAnchor

        public boolean hasPageAnchor()
         Optional. Represents the provenance of this entity wrt. the location on
         the page where it was found.
         
        .google.cloud.documentai.v1beta2.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        hasPageAnchor in interface Document.EntityOrBuilder
        Returns:
        Whether the pageAnchor field is set.
      • getPageAnchor

        public Document.PageAnchor getPageAnchor()
         Optional. Represents the provenance of this entity wrt. the location on
         the page where it was found.
         
        .google.cloud.documentai.v1beta2.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getPageAnchor in interface Document.EntityOrBuilder
        Returns:
        The pageAnchor.
      • getPageAnchorOrBuilder

        public Document.PageAnchorOrBuilder getPageAnchorOrBuilder()
         Optional. Represents the provenance of this entity wrt. the location on
         the page where it was found.
         
        .google.cloud.documentai.v1beta2.Document.PageAnchor page_anchor = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getPageAnchorOrBuilder in interface Document.EntityOrBuilder
      • getId

        public String getId()
         Optional. Canonical id. This will be a unique value in the entity list
         for this document.
         
        string id = 7 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getId in interface Document.EntityOrBuilder
        Returns:
        The id.
      • getIdBytes

        public com.google.protobuf.ByteString getIdBytes()
         Optional. Canonical id. This will be a unique value in the entity list
         for this document.
         
        string id = 7 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getIdBytes in interface Document.EntityOrBuilder
        Returns:
        The bytes for id.
      • hasNormalizedValue

        public boolean hasNormalizedValue()
         Optional. Normalized entity value. Absent if the extracted value could
         not be converted or the type (e.g. address) is not supported for certain
         parsers. This field is also only populated for certain supported document
         types.
         
        .google.cloud.documentai.v1beta2.Document.Entity.NormalizedValue normalized_value = 9 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        hasNormalizedValue in interface Document.EntityOrBuilder
        Returns:
        Whether the normalizedValue field is set.
      • getNormalizedValue

        public Document.Entity.NormalizedValue getNormalizedValue()
         Optional. Normalized entity value. Absent if the extracted value could
         not be converted or the type (e.g. address) is not supported for certain
         parsers. This field is also only populated for certain supported document
         types.
         
        .google.cloud.documentai.v1beta2.Document.Entity.NormalizedValue normalized_value = 9 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getNormalizedValue in interface Document.EntityOrBuilder
        Returns:
        The normalizedValue.
      • getNormalizedValueOrBuilder

        public Document.Entity.NormalizedValueOrBuilder getNormalizedValueOrBuilder()
         Optional. Normalized entity value. Absent if the extracted value could
         not be converted or the type (e.g. address) is not supported for certain
         parsers. This field is also only populated for certain supported document
         types.
         
        .google.cloud.documentai.v1beta2.Document.Entity.NormalizedValue normalized_value = 9 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getNormalizedValueOrBuilder in interface Document.EntityOrBuilder
      • getPropertiesList

        public List<Document.Entity> getPropertiesList()
         Optional. Entities can be nested to form a hierarchical data structure
         representing the content in the document.
         
        repeated .google.cloud.documentai.v1beta2.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getPropertiesList in interface Document.EntityOrBuilder
      • getPropertiesOrBuilderList

        public List<? extends Document.EntityOrBuilder> getPropertiesOrBuilderList()
         Optional. Entities can be nested to form a hierarchical data structure
         representing the content in the document.
         
        repeated .google.cloud.documentai.v1beta2.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getPropertiesOrBuilderList in interface Document.EntityOrBuilder
      • getPropertiesCount

        public int getPropertiesCount()
         Optional. Entities can be nested to form a hierarchical data structure
         representing the content in the document.
         
        repeated .google.cloud.documentai.v1beta2.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getPropertiesCount in interface Document.EntityOrBuilder
      • getProperties

        public Document.Entity getProperties​(int index)
         Optional. Entities can be nested to form a hierarchical data structure
         representing the content in the document.
         
        repeated .google.cloud.documentai.v1beta2.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getProperties in interface Document.EntityOrBuilder
      • getPropertiesOrBuilder

        public Document.EntityOrBuilder getPropertiesOrBuilder​(int index)
         Optional. Entities can be nested to form a hierarchical data structure
         representing the content in the document.
         
        repeated .google.cloud.documentai.v1beta2.Document.Entity properties = 10 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getPropertiesOrBuilder in interface Document.EntityOrBuilder
      • hasProvenance

        public boolean hasProvenance()
         Optional. The history of this annotation.
         
        .google.cloud.documentai.v1beta2.Document.Provenance provenance = 11 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        hasProvenance in interface Document.EntityOrBuilder
        Returns:
        Whether the provenance field is set.
      • getProvenance

        public Document.Provenance getProvenance()
         Optional. The history of this annotation.
         
        .google.cloud.documentai.v1beta2.Document.Provenance provenance = 11 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getProvenance in interface Document.EntityOrBuilder
        Returns:
        The provenance.
      • getRedacted

        public boolean getRedacted()
         Optional. Whether the entity will be redacted for de-identification
         purposes.
         
        bool redacted = 12 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getRedacted in interface Document.EntityOrBuilder
        Returns:
        The redacted.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static Document.Entity parseFrom​(ByteBuffer data)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Document.Entity parseFrom​(ByteBuffer data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Document.Entity parseFrom​(com.google.protobuf.ByteString data)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Document.Entity parseFrom​(com.google.protobuf.ByteString data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Document.Entity parseFrom​(byte[] data)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Document.Entity parseFrom​(byte[] data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Document.Entity parseFrom​(com.google.protobuf.CodedInputStream input,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws IOException
        Throws:
        IOException
      • newBuilderForType

        public Document.Entity.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public Document.Entity.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected Document.Entity.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • parser

        public static com.google.protobuf.Parser<Document.Entity> parser()
      • getParserForType

        public com.google.protobuf.Parser<Document.Entity> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public Document.Entity getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder