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
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
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
Name | Description |
values | Iterable<? extends com.google.cloud.vision.v1.Page>
|
Returns
addPages(Page value)
public TextAnnotation.Builder addPages(Page value)
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Parameter
Returns
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
Returns
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
Returns
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
Returns
addPagesBuilder()
public Page.Builder addPagesBuilder()
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Returns
addPagesBuilder(int index)
public Page.Builder addPagesBuilder(int index)
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Parameter
Returns
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public TextAnnotation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
public TextAnnotation build()
Returns
buildPartial()
public TextAnnotation buildPartial()
Returns
clear()
public TextAnnotation.Builder clear()
Returns
Overrides
clearField(Descriptors.FieldDescriptor field)
public TextAnnotation.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public TextAnnotation.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
clearPages()
public TextAnnotation.Builder clearPages()
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Returns
clearText()
public TextAnnotation.Builder clearText()
UTF-8 text detected on the pages.
string text = 2;
Returns
clone()
public TextAnnotation.Builder clone()
Returns
Overrides
getDefaultInstanceForType()
public TextAnnotation getDefaultInstanceForType()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
getPages(int index)
public Page getPages(int index)
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Parameter
Returns
getPagesBuilder(int index)
public Page.Builder getPagesBuilder(int index)
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Parameter
Returns
getPagesBuilderList()
public List<Page.Builder> getPagesBuilderList()
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Returns
getPagesCount()
public int getPagesCount()
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Returns
getPagesList()
public List<Page> getPagesList()
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Returns
getPagesOrBuilder(int index)
public PageOrBuilder getPagesOrBuilder(int index)
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Parameter
Returns
getPagesOrBuilderList()
public List<? extends PageOrBuilder> getPagesOrBuilderList()
List of pages detected by OCR.
repeated .google.cloud.vision.v1.Page pages = 1;
Returns
Type | Description |
List<? extends com.google.cloud.vision.v1.PageOrBuilder> | |
getText()
UTF-8 text detected on the pages.
string text = 2;
Returns
Type | Description |
String | The text.
|
getTextBytes()
public ByteString getTextBytes()
UTF-8 text detected on the pages.
string text = 2;
Returns
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
mergeFrom(TextAnnotation other)
public TextAnnotation.Builder mergeFrom(TextAnnotation other)
Parameter
Returns
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public TextAnnotation.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public TextAnnotation.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final TextAnnotation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
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
Returns
setField(Descriptors.FieldDescriptor field, Object value)
public TextAnnotation.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
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
Returns
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
Returns
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public TextAnnotation.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
setText(String value)
public TextAnnotation.Builder setText(String value)
UTF-8 text detected on the pages.
string text = 2;
Parameter
Name | Description |
value | String
The text to set.
|
Returns
setTextBytes(ByteString value)
public TextAnnotation.Builder setTextBytes(ByteString value)
UTF-8 text detected on the pages.
string text = 2;
Parameter
Name | Description |
value | ByteString
The bytes for text to set.
|
Returns
setUnknownFields(UnknownFieldSet unknownFields)
public final TextAnnotation.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides