Class OcrConfig.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
- com.google.cloud.documentai.v1beta3.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 typegoogle.cloud.documentai.v1beta3.OcrConfig
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OcrConfig.BuilderaddAdvancedOcrOptions(String value)A list of advanced OCR options to further fine-tune OCR behavior.OcrConfig.BuilderaddAdvancedOcrOptionsBytes(com.google.protobuf.ByteString value)A list of advanced OCR options to further fine-tune OCR behavior.OcrConfig.BuilderaddAllAdvancedOcrOptions(Iterable<String> values)A list of advanced OCR options to further fine-tune OCR behavior.OcrConfig.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)OcrConfigbuild()OcrConfigbuildPartial()OcrConfig.Builderclear()OcrConfig.BuilderclearAdvancedOcrOptions()A list of advanced OCR options to further fine-tune OCR behavior.OcrConfig.BuilderclearComputeStyleInfo()Turn on font id model and returns font style information.OcrConfig.BuilderclearEnableImageQualityScores()Enables intelligent document quality scores after OCR.OcrConfig.BuilderclearEnableNativePdfParsing()Enables special handling for PDFs with existing text information.OcrConfig.BuilderclearEnableSymbol()Includes symbol level OCR information if set to true.OcrConfig.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)OcrConfig.BuilderclearHints()Hints for the OCR model.OcrConfig.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)OcrConfig.Builderclone()StringgetAdvancedOcrOptions(int index)A list of advanced OCR options to further fine-tune OCR behavior.com.google.protobuf.ByteStringgetAdvancedOcrOptionsBytes(int index)A list of advanced OCR options to further fine-tune OCR behavior.intgetAdvancedOcrOptionsCount()A list of advanced OCR options to further fine-tune OCR behavior.com.google.protobuf.ProtocolStringListgetAdvancedOcrOptionsList()A list of advanced OCR options to further fine-tune OCR behavior.booleangetComputeStyleInfo()Turn on font id model and returns font style information.OcrConfiggetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()booleangetEnableImageQualityScores()Enables intelligent document quality scores after OCR.booleangetEnableNativePdfParsing()Enables special handling for PDFs with existing text information.booleangetEnableSymbol()Includes symbol level OCR information if set to true.OcrConfig.HintsgetHints()Hints for the OCR model.OcrConfig.Hints.BuildergetHintsBuilder()Hints for the OCR model.OcrConfig.HintsOrBuildergetHintsOrBuilder()Hints for the OCR model.booleanhasHints()Hints for the OCR model.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()OcrConfig.BuildermergeFrom(OcrConfig other)OcrConfig.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)OcrConfig.BuildermergeFrom(com.google.protobuf.Message other)OcrConfig.BuildermergeHints(OcrConfig.Hints value)Hints for the OCR model.OcrConfig.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)OcrConfig.BuildersetAdvancedOcrOptions(int index, String value)A list of advanced OCR options to further fine-tune OCR behavior.OcrConfig.BuildersetComputeStyleInfo(boolean value)Turn on font id model and returns font style information.OcrConfig.BuildersetEnableImageQualityScores(boolean value)Enables intelligent document quality scores after OCR.OcrConfig.BuildersetEnableNativePdfParsing(boolean value)Enables special handling for PDFs with existing text information.OcrConfig.BuildersetEnableSymbol(boolean value)Includes symbol level OCR information if set to true.OcrConfig.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)OcrConfig.BuildersetHints(OcrConfig.Hints value)Hints for the OCR model.OcrConfig.BuildersetHints(OcrConfig.Hints.Builder builderForValue)Hints for the OCR model.OcrConfig.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)OcrConfig.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
clear
public OcrConfig.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
getDefaultInstanceForType
public OcrConfig getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public OcrConfig build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public OcrConfig buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public OcrConfig.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
setField
public OcrConfig.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
clearField
public OcrConfig.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
clearOneof
public OcrConfig.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
setRepeatedField
public OcrConfig.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
addRepeatedField
public OcrConfig.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
mergeFrom
public OcrConfig.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<OcrConfig.Builder>
-
mergeFrom
public OcrConfig.Builder mergeFrom(OcrConfig other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.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:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.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:
hasHintsin interfaceOcrConfigOrBuilder- 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:
getHintsin interfaceOcrConfigOrBuilder- Returns:
- The hints.
-
setHints
public OcrConfig.Builder setHints(OcrConfig.Hints value)
Hints for the OCR model.
.google.cloud.documentai.v1beta3.OcrConfig.Hints hints = 2;
-
setHints
public OcrConfig.Builder setHints(OcrConfig.Hints.Builder builderForValue)
Hints for the OCR model.
.google.cloud.documentai.v1beta3.OcrConfig.Hints hints = 2;
-
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;
-
getHintsOrBuilder
public OcrConfig.HintsOrBuilder getHintsOrBuilder()
Hints for the OCR model.
.google.cloud.documentai.v1beta3.OcrConfig.Hints hints = 2;- Specified by:
getHintsOrBuilderin interfaceOcrConfigOrBuilder
-
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:
getEnableNativePdfParsingin interfaceOcrConfigOrBuilder- 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:
getEnableImageQualityScoresin interfaceOcrConfigOrBuilder- 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:
getAdvancedOcrOptionsListin interfaceOcrConfigOrBuilder- 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:
getAdvancedOcrOptionsCountin interfaceOcrConfigOrBuilder- 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:
getAdvancedOcrOptionsin interfaceOcrConfigOrBuilder- 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:
getAdvancedOcrOptionsBytesin interfaceOcrConfigOrBuilder- 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:
getEnableSymbolin interfaceOcrConfigOrBuilder- 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:
getComputeStyleInfoin interfaceOcrConfigOrBuilder- 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:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
mergeUnknownFields
public final OcrConfig.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
-