Class ImageContext.Builder (2.1.2)

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.v1p4beta1.ImageContext

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
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
NameDescription
valuesIterable<String>

The languageHints to add.

Returns
TypeDescription
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
NameDescription
valueString

The languageHints to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the languageHints to add.

Returns
TypeDescription
ImageContext.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ImageContext.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ImageContext.Builder
Overrides

build()

public ImageContext build()
Returns
TypeDescription
ImageContext

buildPartial()

public ImageContext buildPartial()
Returns
TypeDescription
ImageContext

clear()

public ImageContext.Builder clear()
Returns
TypeDescription
ImageContext.Builder
Overrides

clearCropHintsParams()

public ImageContext.Builder clearCropHintsParams()

Parameters for crop hints annotation request.

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

Returns
TypeDescription
ImageContext.Builder

clearFaceRecognitionParams()

public ImageContext.Builder clearFaceRecognitionParams()

Parameters for face recognition.

.google.cloud.vision.v1p4beta1.FaceRecognitionParams face_recognition_params = 10;

Returns
TypeDescription
ImageContext.Builder

clearField(Descriptors.FieldDescriptor field)

public ImageContext.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
ImageContext.Builder

This builder for chaining.

clearLatLongRect()

public ImageContext.Builder clearLatLongRect()

Not used.

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

Returns
TypeDescription
ImageContext.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public ImageContext.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
ImageContext.Builder
Overrides

clearProductSearchParams()

public ImageContext.Builder clearProductSearchParams()

Parameters for product search.

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

Returns
TypeDescription
ImageContext.Builder

clearTextDetectionParams()

public ImageContext.Builder clearTextDetectionParams()

Parameters for text detection and document text detection.

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

Returns
TypeDescription
ImageContext.Builder

clearWebDetectionParams()

public ImageContext.Builder clearWebDetectionParams()

Parameters for web detection.

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

Returns
TypeDescription
ImageContext.Builder

clone()

public ImageContext.Builder clone()
Returns
TypeDescription
ImageContext.Builder
Overrides

getCropHintsParams()

public CropHintsParams getCropHintsParams()

Parameters for crop hints annotation request.

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

Returns
TypeDescription
CropHintsParams

The cropHintsParams.

getCropHintsParamsBuilder()

public CropHintsParams.Builder getCropHintsParamsBuilder()

Parameters for crop hints annotation request.

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

Returns
TypeDescription
CropHintsParams.Builder

getCropHintsParamsOrBuilder()

public CropHintsParamsOrBuilder getCropHintsParamsOrBuilder()

Parameters for crop hints annotation request.

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

Returns
TypeDescription
CropHintsParamsOrBuilder

getDefaultInstanceForType()

public ImageContext getDefaultInstanceForType()
Returns
TypeDescription
ImageContext

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getFaceRecognitionParams()

public FaceRecognitionParams getFaceRecognitionParams()

Parameters for face recognition.

.google.cloud.vision.v1p4beta1.FaceRecognitionParams face_recognition_params = 10;

Returns
TypeDescription
FaceRecognitionParams

The faceRecognitionParams.

getFaceRecognitionParamsBuilder()

public FaceRecognitionParams.Builder getFaceRecognitionParamsBuilder()

Parameters for face recognition.

.google.cloud.vision.v1p4beta1.FaceRecognitionParams face_recognition_params = 10;

Returns
TypeDescription
FaceRecognitionParams.Builder

getFaceRecognitionParamsOrBuilder()

public FaceRecognitionParamsOrBuilder getFaceRecognitionParamsOrBuilder()

Parameters for face recognition.

.google.cloud.vision.v1p4beta1.FaceRecognitionParams face_recognition_params = 10;

Returns
TypeDescription
FaceRecognitionParamsOrBuilder

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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ProtocolStringList

A list containing the languageHints.

getLatLongRect()

public LatLongRect getLatLongRect()

Not used.

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

Returns
TypeDescription
LatLongRect

The latLongRect.

getLatLongRectBuilder()

public LatLongRect.Builder getLatLongRectBuilder()

Not used.

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

Returns
TypeDescription
LatLongRect.Builder

getLatLongRectOrBuilder()

public LatLongRectOrBuilder getLatLongRectOrBuilder()

Not used.

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

Returns
TypeDescription
LatLongRectOrBuilder

getProductSearchParams()

public ProductSearchParams getProductSearchParams()

Parameters for product search.

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

Returns
TypeDescription
ProductSearchParams

The productSearchParams.

getProductSearchParamsBuilder()

public ProductSearchParams.Builder getProductSearchParamsBuilder()

Parameters for product search.

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

Returns
TypeDescription
ProductSearchParams.Builder

getProductSearchParamsOrBuilder()

public ProductSearchParamsOrBuilder getProductSearchParamsOrBuilder()

Parameters for product search.

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

Returns
TypeDescription
ProductSearchParamsOrBuilder

getTextDetectionParams()

public TextDetectionParams getTextDetectionParams()

Parameters for text detection and document text detection.

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

Returns
TypeDescription
TextDetectionParams

The textDetectionParams.

getTextDetectionParamsBuilder()

public TextDetectionParams.Builder getTextDetectionParamsBuilder()

Parameters for text detection and document text detection.

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

Returns
TypeDescription
TextDetectionParams.Builder

getTextDetectionParamsOrBuilder()

public TextDetectionParamsOrBuilder getTextDetectionParamsOrBuilder()

Parameters for text detection and document text detection.

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

Returns
TypeDescription
TextDetectionParamsOrBuilder

getWebDetectionParams()

public WebDetectionParams getWebDetectionParams()

Parameters for web detection.

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

Returns
TypeDescription
WebDetectionParams

The webDetectionParams.

getWebDetectionParamsBuilder()

public WebDetectionParams.Builder getWebDetectionParamsBuilder()

Parameters for web detection.

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

Returns
TypeDescription
WebDetectionParams.Builder

getWebDetectionParamsOrBuilder()

public WebDetectionParamsOrBuilder getWebDetectionParamsOrBuilder()

Parameters for web detection.

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

Returns
TypeDescription
WebDetectionParamsOrBuilder

hasCropHintsParams()

public boolean hasCropHintsParams()

Parameters for crop hints annotation request.

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

Returns
TypeDescription
boolean

Whether the cropHintsParams field is set.

hasFaceRecognitionParams()

public boolean hasFaceRecognitionParams()

Parameters for face recognition.

.google.cloud.vision.v1p4beta1.FaceRecognitionParams face_recognition_params = 10;

Returns
TypeDescription
boolean

Whether the faceRecognitionParams field is set.

hasLatLongRect()

public boolean hasLatLongRect()

Not used.

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

Returns
TypeDescription
boolean

Whether the latLongRect field is set.

hasProductSearchParams()

public boolean hasProductSearchParams()

Parameters for product search.

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

Returns
TypeDescription
boolean

Whether the productSearchParams field is set.

hasTextDetectionParams()

public boolean hasTextDetectionParams()

Parameters for text detection and document text detection.

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

Returns
TypeDescription
boolean

Whether the textDetectionParams field is set.

hasWebDetectionParams()

public boolean hasWebDetectionParams()

Parameters for web detection.

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

Returns
TypeDescription
boolean

Whether the webDetectionParams field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeCropHintsParams(CropHintsParams value)

public ImageContext.Builder mergeCropHintsParams(CropHintsParams value)

Parameters for crop hints annotation request.

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

Parameter
NameDescription
valueCropHintsParams
Returns
TypeDescription
ImageContext.Builder

mergeFaceRecognitionParams(FaceRecognitionParams value)

public ImageContext.Builder mergeFaceRecognitionParams(FaceRecognitionParams value)

Parameters for face recognition.

.google.cloud.vision.v1p4beta1.FaceRecognitionParams face_recognition_params = 10;

Parameter
NameDescription
valueFaceRecognitionParams
Returns
TypeDescription
ImageContext.Builder

mergeFrom(ImageContext other)

public ImageContext.Builder mergeFrom(ImageContext other)
Parameter
NameDescription
otherImageContext
Returns
TypeDescription
ImageContext.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ImageContext.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ImageContext.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public ImageContext.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
ImageContext.Builder
Overrides

mergeLatLongRect(LatLongRect value)

public ImageContext.Builder mergeLatLongRect(LatLongRect value)

Not used.

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

Parameter
NameDescription
valueLatLongRect
Returns
TypeDescription
ImageContext.Builder

mergeProductSearchParams(ProductSearchParams value)

public ImageContext.Builder mergeProductSearchParams(ProductSearchParams value)

Parameters for product search.

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

Parameter
NameDescription
valueProductSearchParams
Returns
TypeDescription
ImageContext.Builder

mergeTextDetectionParams(TextDetectionParams value)

public ImageContext.Builder mergeTextDetectionParams(TextDetectionParams value)

Parameters for text detection and document text detection.

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

Parameter
NameDescription
valueTextDetectionParams
Returns
TypeDescription
ImageContext.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ImageContext.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ImageContext.Builder
Overrides

mergeWebDetectionParams(WebDetectionParams value)

public ImageContext.Builder mergeWebDetectionParams(WebDetectionParams value)

Parameters for web detection.

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

Parameter
NameDescription
valueWebDetectionParams
Returns
TypeDescription
ImageContext.Builder

setCropHintsParams(CropHintsParams value)

public ImageContext.Builder setCropHintsParams(CropHintsParams value)

Parameters for crop hints annotation request.

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

Parameter
NameDescription
valueCropHintsParams
Returns
TypeDescription
ImageContext.Builder

setCropHintsParams(CropHintsParams.Builder builderForValue)

public ImageContext.Builder setCropHintsParams(CropHintsParams.Builder builderForValue)

Parameters for crop hints annotation request.

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

Parameter
NameDescription
builderForValueCropHintsParams.Builder
Returns
TypeDescription
ImageContext.Builder

setFaceRecognitionParams(FaceRecognitionParams value)

public ImageContext.Builder setFaceRecognitionParams(FaceRecognitionParams value)

Parameters for face recognition.

.google.cloud.vision.v1p4beta1.FaceRecognitionParams face_recognition_params = 10;

Parameter
NameDescription
valueFaceRecognitionParams
Returns
TypeDescription
ImageContext.Builder

setFaceRecognitionParams(FaceRecognitionParams.Builder builderForValue)

public ImageContext.Builder setFaceRecognitionParams(FaceRecognitionParams.Builder builderForValue)

Parameters for face recognition.

.google.cloud.vision.v1p4beta1.FaceRecognitionParams face_recognition_params = 10;

Parameter
NameDescription
builderForValueFaceRecognitionParams.Builder
Returns
TypeDescription
ImageContext.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public ImageContext.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The languageHints to set.

Returns
TypeDescription
ImageContext.Builder

This builder for chaining.

setLatLongRect(LatLongRect value)

public ImageContext.Builder setLatLongRect(LatLongRect value)

Not used.

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

Parameter
NameDescription
valueLatLongRect
Returns
TypeDescription
ImageContext.Builder

setLatLongRect(LatLongRect.Builder builderForValue)

public ImageContext.Builder setLatLongRect(LatLongRect.Builder builderForValue)

Not used.

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

Parameter
NameDescription
builderForValueLatLongRect.Builder
Returns
TypeDescription
ImageContext.Builder

setProductSearchParams(ProductSearchParams value)

public ImageContext.Builder setProductSearchParams(ProductSearchParams value)

Parameters for product search.

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

Parameter
NameDescription
valueProductSearchParams
Returns
TypeDescription
ImageContext.Builder

setProductSearchParams(ProductSearchParams.Builder builderForValue)

public ImageContext.Builder setProductSearchParams(ProductSearchParams.Builder builderForValue)

Parameters for product search.

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

Parameter
NameDescription
builderForValueProductSearchParams.Builder
Returns
TypeDescription
ImageContext.Builder

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

public ImageContext.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
ImageContext.Builder
Overrides

setTextDetectionParams(TextDetectionParams value)

public ImageContext.Builder setTextDetectionParams(TextDetectionParams value)

Parameters for text detection and document text detection.

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

Parameter
NameDescription
valueTextDetectionParams
Returns
TypeDescription
ImageContext.Builder

setTextDetectionParams(TextDetectionParams.Builder builderForValue)

public ImageContext.Builder setTextDetectionParams(TextDetectionParams.Builder builderForValue)

Parameters for text detection and document text detection.

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

Parameter
NameDescription
builderForValueTextDetectionParams.Builder
Returns
TypeDescription
ImageContext.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final ImageContext.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ImageContext.Builder
Overrides

setWebDetectionParams(WebDetectionParams value)

public ImageContext.Builder setWebDetectionParams(WebDetectionParams value)

Parameters for web detection.

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

Parameter
NameDescription
valueWebDetectionParams
Returns
TypeDescription
ImageContext.Builder

setWebDetectionParams(WebDetectionParams.Builder builderForValue)

public ImageContext.Builder setWebDetectionParams(WebDetectionParams.Builder builderForValue)

Parameters for web detection.

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

Parameter
NameDescription
builderForValueWebDetectionParams.Builder
Returns
TypeDescription
ImageContext.Builder