Class Document.TextAnchor.TextSegment.Builder (2.87.0)

public static final class Document.TextAnchor.TextSegment.Builder extends GeneratedMessage.Builder<Document.TextAnchor.TextSegment.Builder> implements Document.TextAnchor.TextSegmentOrBuilder

A text segment in the 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

Protobuf type google.cloud.documentai.v1.Document.TextAnchor.TextSegment

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

build()

public Document.TextAnchor.TextSegment build()
Returns
Type Description
Document.TextAnchor.TextSegment

buildPartial()

public Document.TextAnchor.TextSegment buildPartial()
Returns
Type Description
Document.TextAnchor.TextSegment

clear()

public Document.TextAnchor.TextSegment.Builder clear()
Returns
Type Description
Document.TextAnchor.TextSegment.Builder
Overrides

clearEndIndex()

public Document.TextAnchor.TextSegment.Builder clearEndIndex()

TextSegment half open end UTF-8 char index in the Document.text.

int64 end_index = 2;

Returns
Type Description
Document.TextAnchor.TextSegment.Builder

This builder for chaining.

clearStartIndex()

public Document.TextAnchor.TextSegment.Builder clearStartIndex()

TextSegment start UTF-8 char index in the Document.text.

int64 start_index = 1;

Returns
Type Description
Document.TextAnchor.TextSegment.Builder

This builder for chaining.

getDefaultInstanceForType()

public Document.TextAnchor.TextSegment getDefaultInstanceForType()
Returns
Type Description
Document.TextAnchor.TextSegment

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getEndIndex()

public long getEndIndex()

TextSegment half open end UTF-8 char index in the Document.text.

int64 end_index = 2;

Returns
Type Description
long

The endIndex.

getStartIndex()

public long getStartIndex()

TextSegment start UTF-8 char index in the Document.text.

int64 start_index = 1;

Returns
Type Description
long

The startIndex.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Document.TextAnchor.TextSegment other)

public Document.TextAnchor.TextSegment.Builder mergeFrom(Document.TextAnchor.TextSegment other)
Parameter
Name Description
other Document.TextAnchor.TextSegment
Returns
Type Description
Document.TextAnchor.TextSegment.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Document.TextAnchor.TextSegment.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Document.TextAnchor.TextSegment.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Document.TextAnchor.TextSegment.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Document.TextAnchor.TextSegment.Builder
Overrides

setEndIndex(long value)

public Document.TextAnchor.TextSegment.Builder setEndIndex(long value)

TextSegment half open end UTF-8 char index in the Document.text.

int64 end_index = 2;

Parameter
Name Description
value long

The endIndex to set.

Returns
Type Description
Document.TextAnchor.TextSegment.Builder

This builder for chaining.

setStartIndex(long value)

public Document.TextAnchor.TextSegment.Builder setStartIndex(long value)

TextSegment start UTF-8 char index in the Document.text.

int64 start_index = 1;

Parameter
Name Description
value long

The startIndex to set.

Returns
Type Description
Document.TextAnchor.TextSegment.Builder

This builder for chaining.