Class Block.Builder

  • All Implemented Interfaces:
    BlockOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    Block

    public static final class Block.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Block.Builder>
    implements BlockOrBuilder
     Logical element on the page.
     
    Protobuf type google.cloud.vision.v1.Block
    • 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<Block.Builder>
      • clear

        public Block.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<Block.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<Block.Builder>
      • getDefaultInstanceForType

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

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

        public Block buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public Block.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<Block.Builder>
      • setField

        public Block.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                      Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<Block.Builder>
      • clearField

        public Block.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Block.Builder>
      • clearOneof

        public Block.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Block.Builder>
      • setRepeatedField

        public Block.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                              int index,
                                              Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Block.Builder>
      • addRepeatedField

        public Block.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                              Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Block.Builder>
      • mergeFrom

        public Block.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Block.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Block.Builder>
      • mergeFrom

        public Block.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Block.Builder>
        Throws:
        IOException
      • hasProperty

        public boolean hasProperty()
         Additional information detected for the block.
         
        .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1;
        Specified by:
        hasProperty in interface BlockOrBuilder
        Returns:
        Whether the property field is set.
      • setProperty

        public Block.Builder setProperty​(TextAnnotation.TextProperty value)
         Additional information detected for the block.
         
        .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1;
      • mergeProperty

        public Block.Builder mergeProperty​(TextAnnotation.TextProperty value)
         Additional information detected for the block.
         
        .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1;
      • clearProperty

        public Block.Builder clearProperty()
         Additional information detected for the block.
         
        .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1;
      • getPropertyBuilder

        public TextAnnotation.TextProperty.Builder getPropertyBuilder()
         Additional information detected for the block.
         
        .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1;
      • 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 vertex order will still be (0, 1, 2, 3).
         
        .google.cloud.vision.v1.BoundingPoly bounding_box = 2;
        Specified by:
        hasBoundingBox in interface BlockOrBuilder
        Returns:
        Whether the boundingBox field is set.
      • 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 vertex order will still be (0, 1, 2, 3).
         
        .google.cloud.vision.v1.BoundingPoly bounding_box = 2;
        Specified by:
        getBoundingBox in interface BlockOrBuilder
        Returns:
        The boundingBox.
      • setBoundingBox

        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 vertex order will still be (0, 1, 2, 3).
         
        .google.cloud.vision.v1.BoundingPoly bounding_box = 2;
      • setBoundingBox

        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 vertex order will still be (0, 1, 2, 3).
         
        .google.cloud.vision.v1.BoundingPoly bounding_box = 2;
      • mergeBoundingBox

        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 vertex order will still be (0, 1, 2, 3).
         
        .google.cloud.vision.v1.BoundingPoly bounding_box = 2;
      • 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 vertex order will still be (0, 1, 2, 3).
         
        .google.cloud.vision.v1.BoundingPoly bounding_box = 2;
      • 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 vertex order will still be (0, 1, 2, 3).
         
        .google.cloud.vision.v1.BoundingPoly bounding_box = 2;
      • 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 vertex order will still be (0, 1, 2, 3).
         
        .google.cloud.vision.v1.BoundingPoly bounding_box = 2;
        Specified by:
        getBoundingBoxOrBuilder in interface BlockOrBuilder
      • getParagraphsList

        public List<Paragraph> getParagraphsList()
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
        Specified by:
        getParagraphsList in interface BlockOrBuilder
      • getParagraphsCount

        public int getParagraphsCount()
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
        Specified by:
        getParagraphsCount in interface BlockOrBuilder
      • getParagraphs

        public Paragraph getParagraphs​(int index)
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
        Specified by:
        getParagraphs in interface BlockOrBuilder
      • setParagraphs

        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.v1.Paragraph paragraphs = 3;
      • setParagraphs

        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.v1.Paragraph paragraphs = 3;
      • addParagraphs

        public Block.Builder addParagraphs​(Paragraph value)
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
      • addParagraphs

        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.v1.Paragraph paragraphs = 3;
      • addParagraphs

        public Block.Builder addParagraphs​(Paragraph.Builder builderForValue)
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
      • addParagraphs

        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.v1.Paragraph paragraphs = 3;
      • addAllParagraphs

        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.v1.Paragraph paragraphs = 3;
      • clearParagraphs

        public Block.Builder clearParagraphs()
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
      • removeParagraphs

        public Block.Builder removeParagraphs​(int index)
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
      • getParagraphsBuilder

        public Paragraph.Builder getParagraphsBuilder​(int index)
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
      • getParagraphsOrBuilder

        public ParagraphOrBuilder getParagraphsOrBuilder​(int index)
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
        Specified by:
        getParagraphsOrBuilder in interface BlockOrBuilder
      • addParagraphsBuilder

        public Paragraph.Builder addParagraphsBuilder()
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
      • addParagraphsBuilder

        public Paragraph.Builder addParagraphsBuilder​(int index)
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
      • getParagraphsBuilderList

        public List<Paragraph.Builder> getParagraphsBuilderList()
         List of paragraphs in this block (if this blocks is of type text).
         
        repeated .google.cloud.vision.v1.Paragraph paragraphs = 3;
      • getBlockTypeValue

        public int getBlockTypeValue()
         Detected block type (text, image etc) for this block.
         
        .google.cloud.vision.v1.Block.BlockType block_type = 4;
        Specified by:
        getBlockTypeValue in interface BlockOrBuilder
        Returns:
        The enum numeric value on the wire for blockType.
      • setBlockTypeValue

        public Block.Builder setBlockTypeValue​(int value)
         Detected block type (text, image etc) for this block.
         
        .google.cloud.vision.v1.Block.BlockType block_type = 4;
        Parameters:
        value - The enum numeric value on the wire for blockType to set.
        Returns:
        This builder for chaining.
      • getBlockType

        public Block.BlockType getBlockType()
         Detected block type (text, image etc) for this block.
         
        .google.cloud.vision.v1.Block.BlockType block_type = 4;
        Specified by:
        getBlockType in interface BlockOrBuilder
        Returns:
        The blockType.
      • setBlockType

        public Block.Builder setBlockType​(Block.BlockType value)
         Detected block type (text, image etc) for this block.
         
        .google.cloud.vision.v1.Block.BlockType block_type = 4;
        Parameters:
        value - The blockType to set.
        Returns:
        This builder for chaining.
      • clearBlockType

        public Block.Builder clearBlockType()
         Detected block type (text, image etc) for this block.
         
        .google.cloud.vision.v1.Block.BlockType block_type = 4;
        Returns:
        This builder for chaining.
      • getConfidence

        public float getConfidence()
         Confidence of the OCR results on the block. Range [0, 1].
         
        float confidence = 5;
        Specified by:
        getConfidence in interface BlockOrBuilder
        Returns:
        The confidence.
      • setConfidence

        public Block.Builder setConfidence​(float value)
         Confidence of the OCR results on the block. Range [0, 1].
         
        float confidence = 5;
        Parameters:
        value - The confidence to set.
        Returns:
        This builder for chaining.
      • clearConfidence

        public Block.Builder clearConfidence()
         Confidence of the OCR results on the block. Range [0, 1].
         
        float confidence = 5;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final Block.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Block.Builder>
      • mergeUnknownFields

        public final Block.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Block.Builder>