Class 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.GeneratedMessageV3.Builder<OcrConfig.Builder>
    implements OcrConfigOrBuilder
     Config for Document OCR.
     
    Protobuf type google.cloud.documentai.v1beta3.OcrConfig
    • 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<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.GeneratedMessageV3.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.GeneratedMessageV3.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
      • clone

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

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

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

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

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

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

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.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.v1beta3.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.v1beta3.OcrConfig.Hints hints = 2;
        Specified by:
        getHints in interface OcrConfigOrBuilder
        Returns:
        The hints.
      • mergeHints

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

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

        public OcrConfig.Hints.Builder getHintsBuilder()
         Hints for the OCR model.
         
        .google.cloud.documentai.v1beta3.OcrConfig.Hints hints = 2;
      • 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

        public boolean getComputeStyleInfo()
         Turn on font id model and returns font style information.
         
        bool compute_style_info = 8;
        Specified by:
        getComputeStyleInfo in interface OcrConfigOrBuilder
        Returns:
        The computeStyleInfo.
      • setComputeStyleInfo

        public OcrConfig.Builder setComputeStyleInfo​(boolean value)
         Turn on font id model and returns font style information.
         
        bool compute_style_info = 8;
        Parameters:
        value - The computeStyleInfo to set.
        Returns:
        This builder for chaining.
      • clearComputeStyleInfo

        public OcrConfig.Builder clearComputeStyleInfo()
         Turn on font id model and returns font style information.
         
        bool compute_style_info = 8;
        Returns:
        This builder for chaining.
      • setUnknownFields

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

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