Class TextAnnotation.Builder (3.7.0)

public static final class TextAnnotation.Builder extends GeneratedMessageV3.Builder<TextAnnotation.Builder> implements TextAnnotationOrBuilder

TextAnnotation contains a structured representation of OCR extracted text. The hierarchy of an OCR extracted text structure is like this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. Please refer to the TextAnnotation.TextProperty message definition below for more detail.

Protobuf type google.cloud.vision.v1.TextAnnotation

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllPages(Iterable<? extends Page> values)

public TextAnnotation.Builder addAllPages(Iterable<? extends Page> values)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.vision.v1.Page>
Returns
TypeDescription
TextAnnotation.Builder

addPages(Page value)

public TextAnnotation.Builder addPages(Page value)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameter
NameDescription
valuePage
Returns
TypeDescription
TextAnnotation.Builder

addPages(Page.Builder builderForValue)

public TextAnnotation.Builder addPages(Page.Builder builderForValue)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameter
NameDescription
builderForValuePage.Builder
Returns
TypeDescription
TextAnnotation.Builder

addPages(int index, Page value)

public TextAnnotation.Builder addPages(int index, Page value)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameters
NameDescription
indexint
valuePage
Returns
TypeDescription
TextAnnotation.Builder

addPages(int index, Page.Builder builderForValue)

public TextAnnotation.Builder addPages(int index, Page.Builder builderForValue)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameters
NameDescription
indexint
builderForValuePage.Builder
Returns
TypeDescription
TextAnnotation.Builder

addPagesBuilder()

public Page.Builder addPagesBuilder()

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Returns
TypeDescription
Page.Builder

addPagesBuilder(int index)

public Page.Builder addPagesBuilder(int index)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Page.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public TextAnnotation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
TextAnnotation.Builder
Overrides

build()

public TextAnnotation build()
Returns
TypeDescription
TextAnnotation

buildPartial()

public TextAnnotation buildPartial()
Returns
TypeDescription
TextAnnotation

clear()

public TextAnnotation.Builder clear()
Returns
TypeDescription
TextAnnotation.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public TextAnnotation.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
TextAnnotation.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public TextAnnotation.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
TextAnnotation.Builder
Overrides

clearPages()

public TextAnnotation.Builder clearPages()

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Returns
TypeDescription
TextAnnotation.Builder

clearText()

public TextAnnotation.Builder clearText()

UTF-8 text detected on the pages.

string text = 2;

Returns
TypeDescription
TextAnnotation.Builder

This builder for chaining.

clone()

public TextAnnotation.Builder clone()
Returns
TypeDescription
TextAnnotation.Builder
Overrides

getDefaultInstanceForType()

public TextAnnotation getDefaultInstanceForType()
Returns
TypeDescription
TextAnnotation

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getPages(int index)

public Page getPages(int index)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Page

getPagesBuilder(int index)

public Page.Builder getPagesBuilder(int index)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
Page.Builder

getPagesBuilderList()

public List<Page.Builder> getPagesBuilderList()

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Returns
TypeDescription
List<Builder>

getPagesCount()

public int getPagesCount()

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Returns
TypeDescription
int

getPagesList()

public List<Page> getPagesList()

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Returns
TypeDescription
List<Page>

getPagesOrBuilder(int index)

public PageOrBuilder getPagesOrBuilder(int index)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
PageOrBuilder

getPagesOrBuilderList()

public List<? extends PageOrBuilder> getPagesOrBuilderList()

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Returns
TypeDescription
List<? extends com.google.cloud.vision.v1.PageOrBuilder>

getText()

public String getText()

UTF-8 text detected on the pages.

string text = 2;

Returns
TypeDescription
String

The text.

getTextBytes()

public ByteString getTextBytes()

UTF-8 text detected on the pages.

string text = 2;

Returns
TypeDescription
ByteString

The bytes for text.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(TextAnnotation other)

public TextAnnotation.Builder mergeFrom(TextAnnotation other)
Parameter
NameDescription
otherTextAnnotation
Returns
TypeDescription
TextAnnotation.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public TextAnnotation.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TextAnnotation.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public TextAnnotation.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
TextAnnotation.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final TextAnnotation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
TextAnnotation.Builder
Overrides

removePages(int index)

public TextAnnotation.Builder removePages(int index)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
TextAnnotation.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public TextAnnotation.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
TextAnnotation.Builder
Overrides

setPages(int index, Page value)

public TextAnnotation.Builder setPages(int index, Page value)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameters
NameDescription
indexint
valuePage
Returns
TypeDescription
TextAnnotation.Builder

setPages(int index, Page.Builder builderForValue)

public TextAnnotation.Builder setPages(int index, Page.Builder builderForValue)

List of pages detected by OCR.

repeated .google.cloud.vision.v1.Page pages = 1;

Parameters
NameDescription
indexint
builderForValuePage.Builder
Returns
TypeDescription
TextAnnotation.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public TextAnnotation.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
TextAnnotation.Builder
Overrides

setText(String value)

public TextAnnotation.Builder setText(String value)

UTF-8 text detected on the pages.

string text = 2;

Parameter
NameDescription
valueString

The text to set.

Returns
TypeDescription
TextAnnotation.Builder

This builder for chaining.

setTextBytes(ByteString value)

public TextAnnotation.Builder setTextBytes(ByteString value)

UTF-8 text detected on the pages.

string text = 2;

Parameter
NameDescription
valueByteString

The bytes for text to set.

Returns
TypeDescription
TextAnnotation.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final TextAnnotation.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
TextAnnotation.Builder
Overrides