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.v1p1beta1.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.v1p1beta1.CropHintsParams crop_hints_params = 4;

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()

lat/long rectangle that specifies the location of the image.

.google.cloud.vision.v1p1beta1.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

clearTextDetectionParams()

public ImageContext.Builder clearTextDetectionParams()

Parameters for text detection and document text detection.

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

Returns
TypeDescription
ImageContext.Builder

clearWebDetectionParams()

public ImageContext.Builder clearWebDetectionParams()

Parameters for web detection.

.google.cloud.vision.v1p1beta1.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.v1p1beta1.CropHintsParams crop_hints_params = 4;

Returns
TypeDescription
CropHintsParams

The cropHintsParams.

getCropHintsParamsBuilder()

public CropHintsParams.Builder getCropHintsParamsBuilder()

Parameters for crop hints annotation request.

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

Returns
TypeDescription
CropHintsParams.Builder

getCropHintsParamsOrBuilder()

public CropHintsParamsOrBuilder getCropHintsParamsOrBuilder()

Parameters for crop hints annotation request.

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

Returns
TypeDescription
CropHintsParamsOrBuilder

getDefaultInstanceForType()

public ImageContext getDefaultInstanceForType()
Returns
TypeDescription
ImageContext

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
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()

lat/long rectangle that specifies the location of the image.

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

Returns
TypeDescription
LatLongRect

The latLongRect.

getLatLongRectBuilder()

public LatLongRect.Builder getLatLongRectBuilder()

lat/long rectangle that specifies the location of the image.

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

Returns
TypeDescription
LatLongRect.Builder

getLatLongRectOrBuilder()

public LatLongRectOrBuilder getLatLongRectOrBuilder()

lat/long rectangle that specifies the location of the image.

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

Returns
TypeDescription
LatLongRectOrBuilder

getTextDetectionParams()

public TextDetectionParams getTextDetectionParams()

Parameters for text detection and document text detection.

.google.cloud.vision.v1p1beta1.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.v1p1beta1.TextDetectionParams text_detection_params = 12;

Returns
TypeDescription
TextDetectionParams.Builder

getTextDetectionParamsOrBuilder()

public TextDetectionParamsOrBuilder getTextDetectionParamsOrBuilder()

Parameters for text detection and document text detection.

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

Returns
TypeDescription
TextDetectionParamsOrBuilder

getWebDetectionParams()

public WebDetectionParams getWebDetectionParams()

Parameters for web detection.

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

Returns
TypeDescription
WebDetectionParams

The webDetectionParams.

getWebDetectionParamsBuilder()

public WebDetectionParams.Builder getWebDetectionParamsBuilder()

Parameters for web detection.

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

Returns
TypeDescription
WebDetectionParams.Builder

getWebDetectionParamsOrBuilder()

public WebDetectionParamsOrBuilder getWebDetectionParamsOrBuilder()

Parameters for web detection.

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

Returns
TypeDescription
WebDetectionParamsOrBuilder

hasCropHintsParams()

public boolean hasCropHintsParams()

Parameters for crop hints annotation request.

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

Returns
TypeDescription
boolean

Whether the cropHintsParams field is set.

hasLatLongRect()

public boolean hasLatLongRect()

lat/long rectangle that specifies the location of the image.

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

Returns
TypeDescription
boolean

Whether the latLongRect field is set.

hasTextDetectionParams()

public boolean hasTextDetectionParams()

Parameters for text detection and document text detection.

.google.cloud.vision.v1p1beta1.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.v1p1beta1.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.v1p1beta1.CropHintsParams crop_hints_params = 4;

Parameter
NameDescription
valueCropHintsParams
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)

lat/long rectangle that specifies the location of the image.

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

Parameter
NameDescription
valueLatLongRect
Returns
TypeDescription
ImageContext.Builder

mergeTextDetectionParams(TextDetectionParams value)

public ImageContext.Builder mergeTextDetectionParams(TextDetectionParams value)

Parameters for text detection and document text detection.

.google.cloud.vision.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.CropHintsParams crop_hints_params = 4;

Parameter
NameDescription
builderForValueCropHintsParams.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)

lat/long rectangle that specifies the location of the image.

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

Parameter
NameDescription
valueLatLongRect
Returns
TypeDescription
ImageContext.Builder

setLatLongRect(LatLongRect.Builder builderForValue)

public ImageContext.Builder setLatLongRect(LatLongRect.Builder builderForValue)

lat/long rectangle that specifies the location of the image.

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

Parameter
NameDescription
builderForValueLatLongRect.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.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.v1p1beta1.WebDetectionParams web_detection_params = 6;

Parameter
NameDescription
builderForValueWebDetectionParams.Builder
Returns
TypeDescription
ImageContext.Builder