Class ImageContext.Builder (3.41.0)

public static final class ImageContext.Builder extends GeneratedMessageV3.Builder<ImageContext.Builder> implements ImageContextOrBuilder

Image context and/or feature-specific parameters.

Protobuf type google.cloud.vision.v1.ImageContext

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllLanguageHints(Iterable<String> values)

public ImageContext.Builder addAllLanguageHints(Iterable<String> values)

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Parameter
Name Description
values Iterable<String>

The languageHints to add.

Returns
Type Description
ImageContext.Builder

This builder for chaining.

addLanguageHints(String value)

public ImageContext.Builder addLanguageHints(String value)

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Parameter
Name Description
value String

The languageHints to add.

Returns
Type Description
ImageContext.Builder

This builder for chaining.

addLanguageHintsBytes(ByteString value)

public ImageContext.Builder addLanguageHintsBytes(ByteString value)

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Parameter
Name Description
value ByteString

The bytes of the languageHints to add.

Returns
Type Description
ImageContext.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ImageContext.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ImageContext.Builder
Overrides

build()

public ImageContext build()
Returns
Type Description
ImageContext

buildPartial()

public ImageContext buildPartial()
Returns
Type Description
ImageContext

clear()

public ImageContext.Builder clear()
Returns
Type Description
ImageContext.Builder
Overrides

clearCropHintsParams()

public ImageContext.Builder clearCropHintsParams()

Parameters for crop hints annotation request.

.google.cloud.vision.v1.CropHintsParams crop_hints_params = 4;

Returns
Type Description
ImageContext.Builder

clearField(Descriptors.FieldDescriptor field)

public ImageContext.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ImageContext.Builder
Overrides

clearLanguageHints()

public ImageContext.Builder clearLanguageHints()

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Returns
Type Description
ImageContext.Builder

This builder for chaining.

clearLatLongRect()

public ImageContext.Builder clearLatLongRect()

Not used.

.google.cloud.vision.v1.LatLongRect lat_long_rect = 1;

Returns
Type Description
ImageContext.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public ImageContext.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ImageContext.Builder
Overrides

clearProductSearchParams()

public ImageContext.Builder clearProductSearchParams()

Parameters for product search.

.google.cloud.vision.v1.ProductSearchParams product_search_params = 5;

Returns
Type Description
ImageContext.Builder

clearTextDetectionParams()

public ImageContext.Builder clearTextDetectionParams()

Parameters for text detection and document text detection.

.google.cloud.vision.v1.TextDetectionParams text_detection_params = 12;

Returns
Type Description
ImageContext.Builder

clearWebDetectionParams()

public ImageContext.Builder clearWebDetectionParams()

Parameters for web detection.

.google.cloud.vision.v1.WebDetectionParams web_detection_params = 6;

Returns
Type Description
ImageContext.Builder

clone()

public ImageContext.Builder clone()
Returns
Type Description
ImageContext.Builder
Overrides

getCropHintsParams()

public CropHintsParams getCropHintsParams()

Parameters for crop hints annotation request.

.google.cloud.vision.v1.CropHintsParams crop_hints_params = 4;

Returns
Type Description
CropHintsParams

The cropHintsParams.

getCropHintsParamsBuilder()

public CropHintsParams.Builder getCropHintsParamsBuilder()

Parameters for crop hints annotation request.

.google.cloud.vision.v1.CropHintsParams crop_hints_params = 4;

Returns
Type Description
CropHintsParams.Builder

getCropHintsParamsOrBuilder()

public CropHintsParamsOrBuilder getCropHintsParamsOrBuilder()

Parameters for crop hints annotation request.

.google.cloud.vision.v1.CropHintsParams crop_hints_params = 4;

Returns
Type Description
CropHintsParamsOrBuilder

getDefaultInstanceForType()

public ImageContext getDefaultInstanceForType()
Returns
Type Description
ImageContext

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getLanguageHints(int index)

public String getLanguageHints(int index)

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The languageHints at the given index.

getLanguageHintsBytes(int index)

public ByteString getLanguageHintsBytes(int index)

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the languageHints at the given index.

getLanguageHintsCount()

public int getLanguageHintsCount()

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Returns
Type Description
int

The count of languageHints.

getLanguageHintsList()

public ProtocolStringList getLanguageHintsList()

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Returns
Type Description
ProtocolStringList

A list containing the languageHints.

getLatLongRect()

public LatLongRect getLatLongRect()

Not used.

.google.cloud.vision.v1.LatLongRect lat_long_rect = 1;

Returns
Type Description
LatLongRect

The latLongRect.

getLatLongRectBuilder()

public LatLongRect.Builder getLatLongRectBuilder()

Not used.

.google.cloud.vision.v1.LatLongRect lat_long_rect = 1;

Returns
Type Description
LatLongRect.Builder

getLatLongRectOrBuilder()

public LatLongRectOrBuilder getLatLongRectOrBuilder()

Not used.

.google.cloud.vision.v1.LatLongRect lat_long_rect = 1;

Returns
Type Description
LatLongRectOrBuilder

getProductSearchParams()

public ProductSearchParams getProductSearchParams()

Parameters for product search.

.google.cloud.vision.v1.ProductSearchParams product_search_params = 5;

Returns
Type Description
ProductSearchParams

The productSearchParams.

getProductSearchParamsBuilder()

public ProductSearchParams.Builder getProductSearchParamsBuilder()

Parameters for product search.

.google.cloud.vision.v1.ProductSearchParams product_search_params = 5;

Returns
Type Description
ProductSearchParams.Builder

getProductSearchParamsOrBuilder()

public ProductSearchParamsOrBuilder getProductSearchParamsOrBuilder()

Parameters for product search.

.google.cloud.vision.v1.ProductSearchParams product_search_params = 5;

Returns
Type Description
ProductSearchParamsOrBuilder

getTextDetectionParams()

public TextDetectionParams getTextDetectionParams()

Parameters for text detection and document text detection.

.google.cloud.vision.v1.TextDetectionParams text_detection_params = 12;

Returns
Type Description
TextDetectionParams

The textDetectionParams.

getTextDetectionParamsBuilder()

public TextDetectionParams.Builder getTextDetectionParamsBuilder()

Parameters for text detection and document text detection.

.google.cloud.vision.v1.TextDetectionParams text_detection_params = 12;

Returns
Type Description
TextDetectionParams.Builder

getTextDetectionParamsOrBuilder()

public TextDetectionParamsOrBuilder getTextDetectionParamsOrBuilder()

Parameters for text detection and document text detection.

.google.cloud.vision.v1.TextDetectionParams text_detection_params = 12;

Returns
Type Description
TextDetectionParamsOrBuilder

getWebDetectionParams()

public WebDetectionParams getWebDetectionParams()

Parameters for web detection.

.google.cloud.vision.v1.WebDetectionParams web_detection_params = 6;

Returns
Type Description
WebDetectionParams

The webDetectionParams.

getWebDetectionParamsBuilder()

public WebDetectionParams.Builder getWebDetectionParamsBuilder()

Parameters for web detection.

.google.cloud.vision.v1.WebDetectionParams web_detection_params = 6;

Returns
Type Description
WebDetectionParams.Builder

getWebDetectionParamsOrBuilder()

public WebDetectionParamsOrBuilder getWebDetectionParamsOrBuilder()

Parameters for web detection.

.google.cloud.vision.v1.WebDetectionParams web_detection_params = 6;

Returns
Type Description
WebDetectionParamsOrBuilder

hasCropHintsParams()

public boolean hasCropHintsParams()

Parameters for crop hints annotation request.

.google.cloud.vision.v1.CropHintsParams crop_hints_params = 4;

Returns
Type Description
boolean

Whether the cropHintsParams field is set.

hasLatLongRect()

public boolean hasLatLongRect()

Not used.

.google.cloud.vision.v1.LatLongRect lat_long_rect = 1;

Returns
Type Description
boolean

Whether the latLongRect field is set.

hasProductSearchParams()

public boolean hasProductSearchParams()

Parameters for product search.

.google.cloud.vision.v1.ProductSearchParams product_search_params = 5;

Returns
Type Description
boolean

Whether the productSearchParams field is set.

hasTextDetectionParams()

public boolean hasTextDetectionParams()

Parameters for text detection and document text detection.

.google.cloud.vision.v1.TextDetectionParams text_detection_params = 12;

Returns
Type Description
boolean

Whether the textDetectionParams field is set.

hasWebDetectionParams()

public boolean hasWebDetectionParams()

Parameters for web detection.

.google.cloud.vision.v1.WebDetectionParams web_detection_params = 6;

Returns
Type Description
boolean

Whether the webDetectionParams field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeCropHintsParams(CropHintsParams value)

public ImageContext.Builder mergeCropHintsParams(CropHintsParams value)

Parameters for crop hints annotation request.

.google.cloud.vision.v1.CropHintsParams crop_hints_params = 4;

Parameter
Name Description
value CropHintsParams
Returns
Type Description
ImageContext.Builder

mergeFrom(ImageContext other)

public ImageContext.Builder mergeFrom(ImageContext other)
Parameter
Name Description
other ImageContext
Returns
Type Description
ImageContext.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ImageContext.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImageContext.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public ImageContext.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
ImageContext.Builder
Overrides

mergeLatLongRect(LatLongRect value)

public ImageContext.Builder mergeLatLongRect(LatLongRect value)

Not used.

.google.cloud.vision.v1.LatLongRect lat_long_rect = 1;

Parameter
Name Description
value LatLongRect
Returns
Type Description
ImageContext.Builder

mergeProductSearchParams(ProductSearchParams value)

public ImageContext.Builder mergeProductSearchParams(ProductSearchParams value)

Parameters for product search.

.google.cloud.vision.v1.ProductSearchParams product_search_params = 5;

Parameter
Name Description
value ProductSearchParams
Returns
Type Description
ImageContext.Builder

mergeTextDetectionParams(TextDetectionParams value)

public ImageContext.Builder mergeTextDetectionParams(TextDetectionParams value)

Parameters for text detection and document text detection.

.google.cloud.vision.v1.TextDetectionParams text_detection_params = 12;

Parameter
Name Description
value TextDetectionParams
Returns
Type Description
ImageContext.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ImageContext.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ImageContext.Builder
Overrides

mergeWebDetectionParams(WebDetectionParams value)

public ImageContext.Builder mergeWebDetectionParams(WebDetectionParams value)

Parameters for web detection.

.google.cloud.vision.v1.WebDetectionParams web_detection_params = 6;

Parameter
Name Description
value WebDetectionParams
Returns
Type Description
ImageContext.Builder

setCropHintsParams(CropHintsParams value)

public ImageContext.Builder setCropHintsParams(CropHintsParams value)

Parameters for crop hints annotation request.

.google.cloud.vision.v1.CropHintsParams crop_hints_params = 4;

Parameter
Name Description
value CropHintsParams
Returns
Type Description
ImageContext.Builder

setCropHintsParams(CropHintsParams.Builder builderForValue)

public ImageContext.Builder setCropHintsParams(CropHintsParams.Builder builderForValue)

Parameters for crop hints annotation request.

.google.cloud.vision.v1.CropHintsParams crop_hints_params = 4;

Parameter
Name Description
builderForValue CropHintsParams.Builder
Returns
Type Description
ImageContext.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public ImageContext.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ImageContext.Builder
Overrides

setLanguageHints(int index, String value)

public ImageContext.Builder setLanguageHints(int index, String value)

List of languages to use for TEXT_DETECTION. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting language_hints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Text detection returns an error if one or more of the specified languages is not one of the supported languages.

repeated string language_hints = 2;

Parameters
Name Description
index int

The index to set the value at.

value String

The languageHints to set.

Returns
Type Description
ImageContext.Builder

This builder for chaining.

setLatLongRect(LatLongRect value)

public ImageContext.Builder setLatLongRect(LatLongRect value)

Not used.

.google.cloud.vision.v1.LatLongRect lat_long_rect = 1;

Parameter
Name Description
value LatLongRect
Returns
Type Description
ImageContext.Builder

setLatLongRect(LatLongRect.Builder builderForValue)

public ImageContext.Builder setLatLongRect(LatLongRect.Builder builderForValue)

Not used.

.google.cloud.vision.v1.LatLongRect lat_long_rect = 1;

Parameter
Name Description
builderForValue LatLongRect.Builder
Returns
Type Description
ImageContext.Builder

setProductSearchParams(ProductSearchParams value)

public ImageContext.Builder setProductSearchParams(ProductSearchParams value)

Parameters for product search.

.google.cloud.vision.v1.ProductSearchParams product_search_params = 5;

Parameter
Name Description
value ProductSearchParams
Returns
Type Description
ImageContext.Builder

setProductSearchParams(ProductSearchParams.Builder builderForValue)

public ImageContext.Builder setProductSearchParams(ProductSearchParams.Builder builderForValue)

Parameters for product search.

.google.cloud.vision.v1.ProductSearchParams product_search_params = 5;

Parameter
Name Description
builderForValue ProductSearchParams.Builder
Returns
Type Description
ImageContext.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public ImageContext.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
ImageContext.Builder
Overrides

setTextDetectionParams(TextDetectionParams value)

public ImageContext.Builder setTextDetectionParams(TextDetectionParams value)

Parameters for text detection and document text detection.

.google.cloud.vision.v1.TextDetectionParams text_detection_params = 12;

Parameter
Name Description
value TextDetectionParams
Returns
Type Description
ImageContext.Builder

setTextDetectionParams(TextDetectionParams.Builder builderForValue)

public ImageContext.Builder setTextDetectionParams(TextDetectionParams.Builder builderForValue)

Parameters for text detection and document text detection.

.google.cloud.vision.v1.TextDetectionParams text_detection_params = 12;

Parameter
Name Description
builderForValue TextDetectionParams.Builder
Returns
Type Description
ImageContext.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final ImageContext.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ImageContext.Builder
Overrides

setWebDetectionParams(WebDetectionParams value)

public ImageContext.Builder setWebDetectionParams(WebDetectionParams value)

Parameters for web detection.

.google.cloud.vision.v1.WebDetectionParams web_detection_params = 6;

Parameter
Name Description
value WebDetectionParams
Returns
Type Description
ImageContext.Builder

setWebDetectionParams(WebDetectionParams.Builder builderForValue)

public ImageContext.Builder setWebDetectionParams(WebDetectionParams.Builder builderForValue)

Parameters for web detection.

.google.cloud.vision.v1.WebDetectionParams web_detection_params = 6;

Parameter
Name Description
builderForValue WebDetectionParams.Builder
Returns
Type Description
ImageContext.Builder