Class Block.Builder (3.6.0)

public static final class Block.Builder extends GeneratedMessageV3.Builder<Block.Builder> implements BlockOrBuilder

Logical element on the page.

Protobuf type google.cloud.vision.v1p2beta1.Block

Implements

BlockOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllParagraphs(Iterable<? extends Paragraph> values)

public Block.Builder addAllParagraphs(Iterable<? extends Paragraph> values)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.vision.v1p2beta1.Paragraph>
Returns
TypeDescription
Block.Builder

addParagraphs(Paragraph value)

public Block.Builder addParagraphs(Paragraph value)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameter
NameDescription
valueParagraph
Returns
TypeDescription
Block.Builder

addParagraphs(Paragraph.Builder builderForValue)

public Block.Builder addParagraphs(Paragraph.Builder builderForValue)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameter
NameDescription
builderForValueParagraph.Builder
Returns
TypeDescription
Block.Builder

addParagraphs(int index, Paragraph value)

public Block.Builder addParagraphs(int index, Paragraph value)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameters
NameDescription
indexint
valueParagraph
Returns
TypeDescription
Block.Builder

addParagraphs(int index, Paragraph.Builder builderForValue)

public Block.Builder addParagraphs(int index, Paragraph.Builder builderForValue)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameters
NameDescription
indexint
builderForValueParagraph.Builder
Returns
TypeDescription
Block.Builder

addParagraphsBuilder()

public Paragraph.Builder addParagraphsBuilder()

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Returns
TypeDescription
Paragraph.Builder

addParagraphsBuilder(int index)

public Paragraph.Builder addParagraphsBuilder(int index)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Paragraph.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Block build()
Returns
TypeDescription
Block

buildPartial()

public Block buildPartial()
Returns
TypeDescription
Block

clear()

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

clearBlockType()

public Block.Builder clearBlockType()

Detected block type (text, image etc) for this block.

.google.cloud.vision.v1p2beta1.Block.BlockType block_type = 4;

Returns
TypeDescription
Block.Builder

This builder for chaining.

clearBoundingBox()

public Block.Builder clearBoundingBox()

The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example:

  • when the text is horizontal it might look like: 0----1 | | 3----2
  • when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertice order will still be (0, 1, 2, 3).

.google.cloud.vision.v1p2beta1.BoundingPoly bounding_box = 2;

Returns
TypeDescription
Block.Builder

clearConfidence()

public Block.Builder clearConfidence()

Confidence of the OCR results on the block. Range [0, 1].

float confidence = 5;

Returns
TypeDescription
Block.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearParagraphs()

public Block.Builder clearParagraphs()

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Returns
TypeDescription
Block.Builder

clearProperty()

public Block.Builder clearProperty()

Additional information detected for the block.

.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty property = 1;

Returns
TypeDescription
Block.Builder

clone()

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

getBlockType()

public Block.BlockType getBlockType()

Detected block type (text, image etc) for this block.

.google.cloud.vision.v1p2beta1.Block.BlockType block_type = 4;

Returns
TypeDescription
Block.BlockType

The blockType.

getBlockTypeValue()

public int getBlockTypeValue()

Detected block type (text, image etc) for this block.

.google.cloud.vision.v1p2beta1.Block.BlockType block_type = 4;

Returns
TypeDescription
int

The enum numeric value on the wire for blockType.

getBoundingBox()

public BoundingPoly getBoundingBox()

The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example:

  • when the text is horizontal it might look like: 0----1 | | 3----2
  • when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertice order will still be (0, 1, 2, 3).

.google.cloud.vision.v1p2beta1.BoundingPoly bounding_box = 2;

Returns
TypeDescription
BoundingPoly

The boundingBox.

getBoundingBoxBuilder()

public BoundingPoly.Builder getBoundingBoxBuilder()

The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example:

  • when the text is horizontal it might look like: 0----1 | | 3----2
  • when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertice order will still be (0, 1, 2, 3).

.google.cloud.vision.v1p2beta1.BoundingPoly bounding_box = 2;

Returns
TypeDescription
BoundingPoly.Builder

getBoundingBoxOrBuilder()

public BoundingPolyOrBuilder getBoundingBoxOrBuilder()

The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example:

  • when the text is horizontal it might look like: 0----1 | | 3----2
  • when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertice order will still be (0, 1, 2, 3).

.google.cloud.vision.v1p2beta1.BoundingPoly bounding_box = 2;

Returns
TypeDescription
BoundingPolyOrBuilder

getConfidence()

public float getConfidence()

Confidence of the OCR results on the block. Range [0, 1].

float confidence = 5;

Returns
TypeDescription
float

The confidence.

getDefaultInstanceForType()

public Block getDefaultInstanceForType()
Returns
TypeDescription
Block

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getParagraphs(int index)

public Paragraph getParagraphs(int index)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Paragraph

getParagraphsBuilder(int index)

public Paragraph.Builder getParagraphsBuilder(int index)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Paragraph.Builder

getParagraphsBuilderList()

public List<Paragraph.Builder> getParagraphsBuilderList()

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Returns
TypeDescription
List<Builder>

getParagraphsCount()

public int getParagraphsCount()

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Returns
TypeDescription
int

getParagraphsList()

public List<Paragraph> getParagraphsList()

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Returns
TypeDescription
List<Paragraph>

getParagraphsOrBuilder(int index)

public ParagraphOrBuilder getParagraphsOrBuilder(int index)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
ParagraphOrBuilder

getParagraphsOrBuilderList()

public List<? extends ParagraphOrBuilder> getParagraphsOrBuilderList()

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Returns
TypeDescription
List<? extends com.google.cloud.vision.v1p2beta1.ParagraphOrBuilder>

getProperty()

public TextAnnotation.TextProperty getProperty()

Additional information detected for the block.

.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty property = 1;

Returns
TypeDescription
TextAnnotation.TextProperty

The property.

getPropertyBuilder()

public TextAnnotation.TextProperty.Builder getPropertyBuilder()

Additional information detected for the block.

.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty property = 1;

Returns
TypeDescription
TextAnnotation.TextProperty.Builder

getPropertyOrBuilder()

public TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder()

Additional information detected for the block.

.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty property = 1;

Returns
TypeDescription
TextAnnotation.TextPropertyOrBuilder

hasBoundingBox()

public boolean hasBoundingBox()

The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example:

  • when the text is horizontal it might look like: 0----1 | | 3----2
  • when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertice order will still be (0, 1, 2, 3).

.google.cloud.vision.v1p2beta1.BoundingPoly bounding_box = 2;

Returns
TypeDescription
boolean

Whether the boundingBox field is set.

hasProperty()

public boolean hasProperty()

Additional information detected for the block.

.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty property = 1;

Returns
TypeDescription
boolean

Whether the property field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeBoundingBox(BoundingPoly value)

public Block.Builder mergeBoundingBox(BoundingPoly value)

The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example:

  • when the text is horizontal it might look like: 0----1 | | 3----2
  • when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertice order will still be (0, 1, 2, 3).

.google.cloud.vision.v1p2beta1.BoundingPoly bounding_box = 2;

Parameter
NameDescription
valueBoundingPoly
Returns
TypeDescription
Block.Builder

mergeFrom(Block other)

public Block.Builder mergeFrom(Block other)
Parameter
NameDescription
otherBlock
Returns
TypeDescription
Block.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeProperty(TextAnnotation.TextProperty value)

public Block.Builder mergeProperty(TextAnnotation.TextProperty value)

Additional information detected for the block.

.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty property = 1;

Parameter
NameDescription
valueTextAnnotation.TextProperty
Returns
TypeDescription
Block.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

removeParagraphs(int index)

public Block.Builder removeParagraphs(int index)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Block.Builder

setBlockType(Block.BlockType value)

public Block.Builder setBlockType(Block.BlockType value)

Detected block type (text, image etc) for this block.

.google.cloud.vision.v1p2beta1.Block.BlockType block_type = 4;

Parameter
NameDescription
valueBlock.BlockType

The blockType to set.

Returns
TypeDescription
Block.Builder

This builder for chaining.

setBlockTypeValue(int value)

public Block.Builder setBlockTypeValue(int value)

Detected block type (text, image etc) for this block.

.google.cloud.vision.v1p2beta1.Block.BlockType block_type = 4;

Parameter
NameDescription
valueint

The enum numeric value on the wire for blockType to set.

Returns
TypeDescription
Block.Builder

This builder for chaining.

setBoundingBox(BoundingPoly value)

public Block.Builder setBoundingBox(BoundingPoly value)

The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example:

  • when the text is horizontal it might look like: 0----1 | | 3----2
  • when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertice order will still be (0, 1, 2, 3).

.google.cloud.vision.v1p2beta1.BoundingPoly bounding_box = 2;

Parameter
NameDescription
valueBoundingPoly
Returns
TypeDescription
Block.Builder

setBoundingBox(BoundingPoly.Builder builderForValue)

public Block.Builder setBoundingBox(BoundingPoly.Builder builderForValue)

The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example:

  • when the text is horizontal it might look like: 0----1 | | 3----2
  • when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertice order will still be (0, 1, 2, 3).

.google.cloud.vision.v1p2beta1.BoundingPoly bounding_box = 2;

Parameter
NameDescription
builderForValueBoundingPoly.Builder
Returns
TypeDescription
Block.Builder

setConfidence(float value)

public Block.Builder setConfidence(float value)

Confidence of the OCR results on the block. Range [0, 1].

float confidence = 5;

Parameter
NameDescription
valuefloat

The confidence to set.

Returns
TypeDescription
Block.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setParagraphs(int index, Paragraph value)

public Block.Builder setParagraphs(int index, Paragraph value)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameters
NameDescription
indexint
valueParagraph
Returns
TypeDescription
Block.Builder

setParagraphs(int index, Paragraph.Builder builderForValue)

public Block.Builder setParagraphs(int index, Paragraph.Builder builderForValue)

List of paragraphs in this block (if this blocks is of type text).

repeated .google.cloud.vision.v1p2beta1.Paragraph paragraphs = 3;

Parameters
NameDescription
indexint
builderForValueParagraph.Builder
Returns
TypeDescription
Block.Builder

setProperty(TextAnnotation.TextProperty value)

public Block.Builder setProperty(TextAnnotation.TextProperty value)

Additional information detected for the block.

.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty property = 1;

Parameter
NameDescription
valueTextAnnotation.TextProperty
Returns
TypeDescription
Block.Builder

setProperty(TextAnnotation.TextProperty.Builder builderForValue)

public Block.Builder setProperty(TextAnnotation.TextProperty.Builder builderForValue)

Additional information detected for the block.

.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty property = 1;

Parameter
NameDescription
builderForValueTextAnnotation.TextProperty.Builder
Returns
TypeDescription
Block.Builder

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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