Class Document.TextAnchor.TextSegment.Builder

  • All Implemented Interfaces:
    Document.TextAnchor.TextSegmentOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    Document.TextAnchor.TextSegment

    public static final class Document.TextAnchor.TextSegment.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Document.TextAnchor.TextSegment.Builder>
    implements Document.TextAnchor.TextSegmentOrBuilder
     A text segment in the
     [Document.text][google.cloud.documentai.v1.Document.text]. The indices
     may be out of bounds which indicate that the text extends into another
     document shard for large sharded documents. See
     [ShardInfo.text_offset][google.cloud.documentai.v1.Document.ShardInfo.text_offset]
     
    Protobuf type google.cloud.documentai.v1.Document.TextAnchor.TextSegment
    • Method Detail

      • 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.Builder<Document.TextAnchor.TextSegment.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Document.TextAnchor.TextSegment.Builder>
      • getDefaultInstanceForType

        public Document.TextAnchor.TextSegment getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public Document.TextAnchor.TextSegment build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public Document.TextAnchor.TextSegment buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Document.TextAnchor.TextSegment.Builder>
      • getStartIndex

        public long getStartIndex()
         [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
         start UTF-8 char index in the
         [Document.text][google.cloud.documentai.v1.Document.text].
         
        int64 start_index = 1;
        Specified by:
        getStartIndex in interface Document.TextAnchor.TextSegmentOrBuilder
        Returns:
        The startIndex.
      • setStartIndex

        public Document.TextAnchor.TextSegment.Builder setStartIndex​(long value)
         [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
         start UTF-8 char index in the
         [Document.text][google.cloud.documentai.v1.Document.text].
         
        int64 start_index = 1;
        Parameters:
        value - The startIndex to set.
        Returns:
        This builder for chaining.
      • clearStartIndex

        public Document.TextAnchor.TextSegment.Builder clearStartIndex()
         [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
         start UTF-8 char index in the
         [Document.text][google.cloud.documentai.v1.Document.text].
         
        int64 start_index = 1;
        Returns:
        This builder for chaining.
      • getEndIndex

        public long getEndIndex()
         [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
         half open end UTF-8 char index in the
         [Document.text][google.cloud.documentai.v1.Document.text].
         
        int64 end_index = 2;
        Specified by:
        getEndIndex in interface Document.TextAnchor.TextSegmentOrBuilder
        Returns:
        The endIndex.
      • setEndIndex

        public Document.TextAnchor.TextSegment.Builder setEndIndex​(long value)
         [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
         half open end UTF-8 char index in the
         [Document.text][google.cloud.documentai.v1.Document.text].
         
        int64 end_index = 2;
        Parameters:
        value - The endIndex to set.
        Returns:
        This builder for chaining.
      • clearEndIndex

        public Document.TextAnchor.TextSegment.Builder clearEndIndex()
         [TextSegment][google.cloud.documentai.v1.Document.TextAnchor.TextSegment]
         half open end UTF-8 char index in the
         [Document.text][google.cloud.documentai.v1.Document.text].
         
        int64 end_index = 2;
        Returns:
        This builder for chaining.