Class OcrConfig.Builder

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

public static final class OcrConfig.Builder extends com.google.protobuf.GeneratedMessage.Builder<OcrConfig.Builder> implements OcrConfigOrBuilder
 Config for Document OCR.
 
Protobuf type google.cloud.documentai.v1.OcrConfig
  • 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<OcrConfig.Builder>
    • clear

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

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

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

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

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

      public OcrConfig.Builder mergeFrom(OcrConfig other)
    • isInitialized

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

      public OcrConfig.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<OcrConfig.Builder>
      Throws:
      IOException
    • hasHints

      public boolean hasHints()
       Hints for the OCR model.
       
      .google.cloud.documentai.v1.OcrConfig.Hints hints = 2;
      Specified by:
      hasHints in interface OcrConfigOrBuilder
      Returns:
      Whether the hints field is set.
    • getHints

      public OcrConfig.Hints getHints()
       Hints for the OCR model.
       
      .google.cloud.documentai.v1.OcrConfig.Hints hints = 2;
      Specified by:
      getHints in interface OcrConfigOrBuilder
      Returns:
      The hints.
    • setHints

      public OcrConfig.Builder setHints(OcrConfig.Hints value)
       Hints for the OCR model.
       
      .google.cloud.documentai.v1.OcrConfig.Hints hints = 2;
    • setHints

      public OcrConfig.Builder setHints(OcrConfig.Hints.Builder builderForValue)
       Hints for the OCR model.
       
      .google.cloud.documentai.v1.OcrConfig.Hints hints = 2;
    • mergeHints

      public OcrConfig.Builder mergeHints(OcrConfig.Hints value)
       Hints for the OCR model.
       
      .google.cloud.documentai.v1.OcrConfig.Hints hints = 2;
    • clearHints

      public OcrConfig.Builder clearHints()
       Hints for the OCR model.
       
      .google.cloud.documentai.v1.OcrConfig.Hints hints = 2;
    • getHintsBuilder

      public OcrConfig.Hints.Builder getHintsBuilder()
       Hints for the OCR model.
       
      .google.cloud.documentai.v1.OcrConfig.Hints hints = 2;
    • getHintsOrBuilder

      public OcrConfig.HintsOrBuilder getHintsOrBuilder()
       Hints for the OCR model.
       
      .google.cloud.documentai.v1.OcrConfig.Hints hints = 2;
      Specified by:
      getHintsOrBuilder in interface OcrConfigOrBuilder
    • getEnableNativePdfParsing

      public boolean getEnableNativePdfParsing()
       Enables special handling for PDFs with existing text information. Results
       in better text extraction quality in such PDF inputs.
       
      bool enable_native_pdf_parsing = 3;
      Specified by:
      getEnableNativePdfParsing in interface OcrConfigOrBuilder
      Returns:
      The enableNativePdfParsing.
    • setEnableNativePdfParsing

      public OcrConfig.Builder setEnableNativePdfParsing(boolean value)
       Enables special handling for PDFs with existing text information. Results
       in better text extraction quality in such PDF inputs.
       
      bool enable_native_pdf_parsing = 3;
      Parameters:
      value - The enableNativePdfParsing to set.
      Returns:
      This builder for chaining.
    • clearEnableNativePdfParsing

      public OcrConfig.Builder clearEnableNativePdfParsing()
       Enables special handling for PDFs with existing text information. Results
       in better text extraction quality in such PDF inputs.
       
      bool enable_native_pdf_parsing = 3;
      Returns:
      This builder for chaining.
    • getEnableImageQualityScores

      public boolean getEnableImageQualityScores()
       Enables intelligent document quality scores after OCR. Can help with
       diagnosing why OCR responses are of poor quality for a given input.
       Adds additional latency comparable to regular OCR to the process call.
       
      bool enable_image_quality_scores = 4;
      Specified by:
      getEnableImageQualityScores in interface OcrConfigOrBuilder
      Returns:
      The enableImageQualityScores.
    • setEnableImageQualityScores

      public OcrConfig.Builder setEnableImageQualityScores(boolean value)
       Enables intelligent document quality scores after OCR. Can help with
       diagnosing why OCR responses are of poor quality for a given input.
       Adds additional latency comparable to regular OCR to the process call.
       
      bool enable_image_quality_scores = 4;
      Parameters:
      value - The enableImageQualityScores to set.
      Returns:
      This builder for chaining.
    • clearEnableImageQualityScores

      public OcrConfig.Builder clearEnableImageQualityScores()
       Enables intelligent document quality scores after OCR. Can help with
       diagnosing why OCR responses are of poor quality for a given input.
       Adds additional latency comparable to regular OCR to the process call.
       
      bool enable_image_quality_scores = 4;
      Returns:
      This builder for chaining.
    • getAdvancedOcrOptionsList

      public com.google.protobuf.ProtocolStringList getAdvancedOcrOptionsList()
       A list of advanced OCR options to further fine-tune OCR behavior. Current
       valid values are:
      
       - `legacy_layout`: a heuristics layout detection algorithm, which serves as
       an alternative to the current ML-based layout detection algorithm.
       Customers can choose the best suitable layout algorithm based on their
       situation.
       
      repeated string advanced_ocr_options = 5;
      Specified by:
      getAdvancedOcrOptionsList in interface OcrConfigOrBuilder
      Returns:
      A list containing the advancedOcrOptions.
    • getAdvancedOcrOptionsCount

      public int getAdvancedOcrOptionsCount()
       A list of advanced OCR options to further fine-tune OCR behavior. Current
       valid values are:
      
       - `legacy_layout`: a heuristics layout detection algorithm, which serves as
       an alternative to the current ML-based layout detection algorithm.
       Customers can choose the best suitable layout algorithm based on their
       situation.
       
      repeated string advanced_ocr_options = 5;
      Specified by:
      getAdvancedOcrOptionsCount in interface OcrConfigOrBuilder
      Returns:
      The count of advancedOcrOptions.
    • getAdvancedOcrOptions

      public String getAdvancedOcrOptions(int index)
       A list of advanced OCR options to further fine-tune OCR behavior. Current
       valid values are:
      
       - `legacy_layout`: a heuristics layout detection algorithm, which serves as
       an alternative to the current ML-based layout detection algorithm.
       Customers can choose the best suitable layout algorithm based on their
       situation.
       
      repeated string advanced_ocr_options = 5;
      Specified by:
      getAdvancedOcrOptions in interface OcrConfigOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The advancedOcrOptions at the given index.
    • getAdvancedOcrOptionsBytes

      public com.google.protobuf.ByteString getAdvancedOcrOptionsBytes(int index)
       A list of advanced OCR options to further fine-tune OCR behavior. Current
       valid values are:
      
       - `legacy_layout`: a heuristics layout detection algorithm, which serves as
       an alternative to the current ML-based layout detection algorithm.
       Customers can choose the best suitable layout algorithm based on their
       situation.
       
      repeated string advanced_ocr_options = 5;
      Specified by:
      getAdvancedOcrOptionsBytes in interface OcrConfigOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the advancedOcrOptions at the given index.
    • setAdvancedOcrOptions

      public OcrConfig.Builder setAdvancedOcrOptions(int index, String value)
       A list of advanced OCR options to further fine-tune OCR behavior. Current
       valid values are:
      
       - `legacy_layout`: a heuristics layout detection algorithm, which serves as
       an alternative to the current ML-based layout detection algorithm.
       Customers can choose the best suitable layout algorithm based on their
       situation.
       
      repeated string advanced_ocr_options = 5;
      Parameters:
      index - The index to set the value at.
      value - The advancedOcrOptions to set.
      Returns:
      This builder for chaining.
    • addAdvancedOcrOptions

      public OcrConfig.Builder addAdvancedOcrOptions(String value)
       A list of advanced OCR options to further fine-tune OCR behavior. Current
       valid values are:
      
       - `legacy_layout`: a heuristics layout detection algorithm, which serves as
       an alternative to the current ML-based layout detection algorithm.
       Customers can choose the best suitable layout algorithm based on their
       situation.
       
      repeated string advanced_ocr_options = 5;
      Parameters:
      value - The advancedOcrOptions to add.
      Returns:
      This builder for chaining.
    • addAllAdvancedOcrOptions

      public OcrConfig.Builder addAllAdvancedOcrOptions(Iterable<String> values)
       A list of advanced OCR options to further fine-tune OCR behavior. Current
       valid values are:
      
       - `legacy_layout`: a heuristics layout detection algorithm, which serves as
       an alternative to the current ML-based layout detection algorithm.
       Customers can choose the best suitable layout algorithm based on their
       situation.
       
      repeated string advanced_ocr_options = 5;
      Parameters:
      values - The advancedOcrOptions to add.
      Returns:
      This builder for chaining.
    • clearAdvancedOcrOptions

      public OcrConfig.Builder clearAdvancedOcrOptions()
       A list of advanced OCR options to further fine-tune OCR behavior. Current
       valid values are:
      
       - `legacy_layout`: a heuristics layout detection algorithm, which serves as
       an alternative to the current ML-based layout detection algorithm.
       Customers can choose the best suitable layout algorithm based on their
       situation.
       
      repeated string advanced_ocr_options = 5;
      Returns:
      This builder for chaining.
    • addAdvancedOcrOptionsBytes

      public OcrConfig.Builder addAdvancedOcrOptionsBytes(com.google.protobuf.ByteString value)
       A list of advanced OCR options to further fine-tune OCR behavior. Current
       valid values are:
      
       - `legacy_layout`: a heuristics layout detection algorithm, which serves as
       an alternative to the current ML-based layout detection algorithm.
       Customers can choose the best suitable layout algorithm based on their
       situation.
       
      repeated string advanced_ocr_options = 5;
      Parameters:
      value - The bytes of the advancedOcrOptions to add.
      Returns:
      This builder for chaining.
    • getEnableSymbol

      public boolean getEnableSymbol()
       Includes symbol level OCR information if set to true.
       
      bool enable_symbol = 6;
      Specified by:
      getEnableSymbol in interface OcrConfigOrBuilder
      Returns:
      The enableSymbol.
    • setEnableSymbol

      public OcrConfig.Builder setEnableSymbol(boolean value)
       Includes symbol level OCR information if set to true.
       
      bool enable_symbol = 6;
      Parameters:
      value - The enableSymbol to set.
      Returns:
      This builder for chaining.
    • clearEnableSymbol

      public OcrConfig.Builder clearEnableSymbol()
       Includes symbol level OCR information if set to true.
       
      bool enable_symbol = 6;
      Returns:
      This builder for chaining.
    • getComputeStyleInfo

      @Deprecated public boolean getComputeStyleInfo()
      Deprecated.
      google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated. See google/cloud/documentai/v1/document_io.proto;l=166
       Turn on font identification model and return font style information.
       Deprecated, use
       [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info]
       instead.
       
      bool compute_style_info = 8 [deprecated = true];
      Specified by:
      getComputeStyleInfo in interface OcrConfigOrBuilder
      Returns:
      The computeStyleInfo.
    • setComputeStyleInfo

      @Deprecated public OcrConfig.Builder setComputeStyleInfo(boolean value)
      Deprecated.
      google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated. See google/cloud/documentai/v1/document_io.proto;l=166
       Turn on font identification model and return font style information.
       Deprecated, use
       [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info]
       instead.
       
      bool compute_style_info = 8 [deprecated = true];
      Parameters:
      value - The computeStyleInfo to set.
      Returns:
      This builder for chaining.
    • clearComputeStyleInfo

      @Deprecated public OcrConfig.Builder clearComputeStyleInfo()
      Deprecated.
      google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated. See google/cloud/documentai/v1/document_io.proto;l=166
       Turn on font identification model and return font style information.
       Deprecated, use
       [PremiumFeatures.compute_style_info][google.cloud.documentai.v1.OcrConfig.PremiumFeatures.compute_style_info]
       instead.
       
      bool compute_style_info = 8 [deprecated = true];
      Returns:
      This builder for chaining.
    • getDisableCharacterBoxesDetection

      public boolean getDisableCharacterBoxesDetection()
       Turn off character box detector in OCR engine. Character box detection is
       enabled by default in OCR 2.0 (and later) processors.
       
      bool disable_character_boxes_detection = 10;
      Specified by:
      getDisableCharacterBoxesDetection in interface OcrConfigOrBuilder
      Returns:
      The disableCharacterBoxesDetection.
    • setDisableCharacterBoxesDetection

      public OcrConfig.Builder setDisableCharacterBoxesDetection(boolean value)
       Turn off character box detector in OCR engine. Character box detection is
       enabled by default in OCR 2.0 (and later) processors.
       
      bool disable_character_boxes_detection = 10;
      Parameters:
      value - The disableCharacterBoxesDetection to set.
      Returns:
      This builder for chaining.
    • clearDisableCharacterBoxesDetection

      public OcrConfig.Builder clearDisableCharacterBoxesDetection()
       Turn off character box detector in OCR engine. Character box detection is
       enabled by default in OCR 2.0 (and later) processors.
       
      bool disable_character_boxes_detection = 10;
      Returns:
      This builder for chaining.
    • hasPremiumFeatures

      public boolean hasPremiumFeatures()
       Configurations for premium OCR features.
       
      .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;
      Specified by:
      hasPremiumFeatures in interface OcrConfigOrBuilder
      Returns:
      Whether the premiumFeatures field is set.
    • getPremiumFeatures

      public OcrConfig.PremiumFeatures getPremiumFeatures()
       Configurations for premium OCR features.
       
      .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;
      Specified by:
      getPremiumFeatures in interface OcrConfigOrBuilder
      Returns:
      The premiumFeatures.
    • setPremiumFeatures

      public OcrConfig.Builder setPremiumFeatures(OcrConfig.PremiumFeatures value)
       Configurations for premium OCR features.
       
      .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;
    • setPremiumFeatures

      public OcrConfig.Builder setPremiumFeatures(OcrConfig.PremiumFeatures.Builder builderForValue)
       Configurations for premium OCR features.
       
      .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;
    • mergePremiumFeatures

      public OcrConfig.Builder mergePremiumFeatures(OcrConfig.PremiumFeatures value)
       Configurations for premium OCR features.
       
      .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;
    • clearPremiumFeatures

      public OcrConfig.Builder clearPremiumFeatures()
       Configurations for premium OCR features.
       
      .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;
    • getPremiumFeaturesBuilder

      public OcrConfig.PremiumFeatures.Builder getPremiumFeaturesBuilder()
       Configurations for premium OCR features.
       
      .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;
    • getPremiumFeaturesOrBuilder

      public OcrConfig.PremiumFeaturesOrBuilder getPremiumFeaturesOrBuilder()
       Configurations for premium OCR features.
       
      .google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;
      Specified by:
      getPremiumFeaturesOrBuilder in interface OcrConfigOrBuilder