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.Builder
addAdvancedOcrOptions(String value)
A list of advanced OCR options to further fine-tune OCR behavior.OcrConfig.Builder
addAdvancedOcrOptionsBytes(com.google.protobuf.ByteString value)
A list of advanced OCR options to further fine-tune OCR behavior.OcrConfig.Builder
addAllAdvancedOcrOptions(Iterable<String> values)
A list of advanced OCR options to further fine-tune OCR behavior.OcrConfig.Builder
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
OcrConfig
build()
OcrConfig
buildPartial()
OcrConfig.Builder
clear()
OcrConfig.Builder
clearAdvancedOcrOptions()
A list of advanced OCR options to further fine-tune OCR behavior.OcrConfig.Builder
clearComputeStyleInfo()
Turn on font id model and returns font style information.OcrConfig.Builder
clearEnableImageQualityScores()
Enables intelligent document quality scores after OCR.OcrConfig.Builder
clearEnableNativePdfParsing()
Enables special handling for PDFs with existing text information.OcrConfig.Builder
clearEnableSymbol()
Includes symbol level OCR information if set to true.OcrConfig.Builder
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
OcrConfig.Builder
clearHints()
Hints for the OCR model.OcrConfig.Builder
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
OcrConfig.Builder
clone()
String
getAdvancedOcrOptions(int index)
A list of advanced OCR options to further fine-tune OCR behavior.com.google.protobuf.ByteString
getAdvancedOcrOptionsBytes(int index)
A list of advanced OCR options to further fine-tune OCR behavior.int
getAdvancedOcrOptionsCount()
A list of advanced OCR options to further fine-tune OCR behavior.com.google.protobuf.ProtocolStringList
getAdvancedOcrOptionsList()
A list of advanced OCR options to further fine-tune OCR behavior.boolean
getComputeStyleInfo()
Turn on font id model and returns font style information.OcrConfig
getDefaultInstanceForType()
static com.google.protobuf.Descriptors.Descriptor
getDescriptor()
com.google.protobuf.Descriptors.Descriptor
getDescriptorForType()
boolean
getEnableImageQualityScores()
Enables intelligent document quality scores after OCR.boolean
getEnableNativePdfParsing()
Enables special handling for PDFs with existing text information.boolean
getEnableSymbol()
Includes symbol level OCR information if set to true.OcrConfig.Hints
getHints()
Hints for the OCR model.OcrConfig.Hints.Builder
getHintsBuilder()
Hints for the OCR model.OcrConfig.HintsOrBuilder
getHintsOrBuilder()
Hints for the OCR model.boolean
hasHints()
Hints for the OCR model.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()
boolean
isInitialized()
OcrConfig.Builder
mergeFrom(OcrConfig other)
OcrConfig.Builder
mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
OcrConfig.Builder
mergeFrom(com.google.protobuf.Message other)
OcrConfig.Builder
mergeHints(OcrConfig.Hints value)
Hints for the OCR model.OcrConfig.Builder
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
OcrConfig.Builder
setAdvancedOcrOptions(int index, String value)
A list of advanced OCR options to further fine-tune OCR behavior.OcrConfig.Builder
setComputeStyleInfo(boolean value)
Turn on font id model and returns font style information.OcrConfig.Builder
setEnableImageQualityScores(boolean value)
Enables intelligent document quality scores after OCR.OcrConfig.Builder
setEnableNativePdfParsing(boolean value)
Enables special handling for PDFs with existing text information.OcrConfig.Builder
setEnableSymbol(boolean value)
Includes symbol level OCR information if set to true.OcrConfig.Builder
setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
OcrConfig.Builder
setHints(OcrConfig.Hints value)
Hints for the OCR model.OcrConfig.Builder
setHints(OcrConfig.Hints.Builder builderForValue)
Hints for the OCR model.OcrConfig.Builder
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
OcrConfig.Builder
setUnknownFields(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:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
clear
public OcrConfig.Builder clear()
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
getDefaultInstanceForType
public OcrConfig getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
public OcrConfig build()
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public OcrConfig buildPartial()
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
clone
public OcrConfig.Builder clone()
- Specified by:
clone
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clone
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clone
in classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
setField
public OcrConfig.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setField
in classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
clearField
public OcrConfig.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearField
in classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
clearOneof
public OcrConfig.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneof
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearOneof
in classcom.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 interfacecom.google.protobuf.Message.Builder
- Overrides:
setRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
addRepeatedField
public OcrConfig.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
addRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
mergeFrom
public OcrConfig.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<OcrConfig.Builder>
-
mergeFrom
public OcrConfig.Builder mergeFrom(OcrConfig other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in 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:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in 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:
hasHints
in 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:
getHints
in 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:
getHintsOrBuilder
in 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:
getEnableNativePdfParsing
in 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:
getEnableImageQualityScores
in 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:
getAdvancedOcrOptionsList
in 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:
getAdvancedOcrOptionsCount
in 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:
getAdvancedOcrOptions
in 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:
getAdvancedOcrOptionsBytes
in 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:
getEnableSymbol
in 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:
getComputeStyleInfo
in 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:
setUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
mergeUnknownFields
public final OcrConfig.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<OcrConfig.Builder>
-
-