Class TextAnnotation.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<TextAnnotation.Builder>
com.google.cloud.vision.v1.TextAnnotation.Builder
All Implemented Interfaces:
TextAnnotationOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
TextAnnotation

public static final class TextAnnotation.Builder extends com.google.protobuf.GeneratedMessage.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][google.cloud.vision.v1.TextAnnotation.TextProperty]
 message definition below for more detail.
 
Protobuf type google.cloud.vision.v1.TextAnnotation
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<TextAnnotation.Builder>
    • clear

      public TextAnnotation.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.GeneratedMessage.Builder<TextAnnotation.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.GeneratedMessage.Builder<TextAnnotation.Builder>
    • getDefaultInstanceForType

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

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

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

      public TextAnnotation.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<TextAnnotation.Builder>
    • mergeFrom

      public TextAnnotation.Builder mergeFrom(TextAnnotation other)
    • isInitialized

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

      public TextAnnotation.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<TextAnnotation.Builder>
      Throws:
      IOException
    • getPagesList

      public List<Page> getPagesList()
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
      Specified by:
      getPagesList in interface TextAnnotationOrBuilder
    • getPagesCount

      public int getPagesCount()
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
      Specified by:
      getPagesCount in interface TextAnnotationOrBuilder
    • getPages

      public Page getPages(int index)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
      Specified by:
      getPages in interface TextAnnotationOrBuilder
    • setPages

      public TextAnnotation.Builder setPages(int index, Page value)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • setPages

      public TextAnnotation.Builder setPages(int index, Page.Builder builderForValue)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • addPages

      public TextAnnotation.Builder addPages(Page value)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • addPages

      public TextAnnotation.Builder addPages(int index, Page value)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • addPages

      public TextAnnotation.Builder addPages(Page.Builder builderForValue)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • addPages

      public TextAnnotation.Builder addPages(int index, Page.Builder builderForValue)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • addAllPages

      public TextAnnotation.Builder addAllPages(Iterable<? extends Page> values)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • clearPages

      public TextAnnotation.Builder clearPages()
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • removePages

      public TextAnnotation.Builder removePages(int index)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • getPagesBuilder

      public Page.Builder getPagesBuilder(int index)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • getPagesOrBuilder

      public PageOrBuilder getPagesOrBuilder(int index)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
      Specified by:
      getPagesOrBuilder in interface TextAnnotationOrBuilder
    • getPagesOrBuilderList

      public List<? extends PageOrBuilder> getPagesOrBuilderList()
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
      Specified by:
      getPagesOrBuilderList in interface TextAnnotationOrBuilder
    • addPagesBuilder

      public Page.Builder addPagesBuilder()
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • addPagesBuilder

      public Page.Builder addPagesBuilder(int index)
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • getPagesBuilderList

      public List<Page.Builder> getPagesBuilderList()
       List of pages detected by OCR.
       
      repeated .google.cloud.vision.v1.Page pages = 1;
    • getText

      public String getText()
       UTF-8 text detected on the pages.
       
      string text = 2;
      Specified by:
      getText in interface TextAnnotationOrBuilder
      Returns:
      The text.
    • getTextBytes

      public com.google.protobuf.ByteString getTextBytes()
       UTF-8 text detected on the pages.
       
      string text = 2;
      Specified by:
      getTextBytes in interface TextAnnotationOrBuilder
      Returns:
      The bytes for text.
    • setText

      public TextAnnotation.Builder setText(String value)
       UTF-8 text detected on the pages.
       
      string text = 2;
      Parameters:
      value - The text to set.
      Returns:
      This builder for chaining.
    • clearText

      public TextAnnotation.Builder clearText()
       UTF-8 text detected on the pages.
       
      string text = 2;
      Returns:
      This builder for chaining.
    • setTextBytes

      public TextAnnotation.Builder setTextBytes(com.google.protobuf.ByteString value)
       UTF-8 text detected on the pages.
       
      string text = 2;
      Parameters:
      value - The bytes for text to set.
      Returns:
      This builder for chaining.