Class Product.Builder (3.41.0)

public static final class Product.Builder extends GeneratedMessageV3.Builder<Product.Builder> implements ProductOrBuilder

A Product contains ReferenceImages.

Protobuf type google.cloud.vision.v1p3beta1.Product

Implements

ProductOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllProductLabels(Iterable<? extends Product.KeyValue> values)

public Product.Builder addAllProductLabels(Iterable<? extends Product.KeyValue> values)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameter
Name Description
values Iterable<? extends com.google.cloud.vision.v1p3beta1.Product.KeyValue>
Returns
Type Description
Product.Builder

addProductLabels(Product.KeyValue value)

public Product.Builder addProductLabels(Product.KeyValue value)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameter
Name Description
value Product.KeyValue
Returns
Type Description
Product.Builder

addProductLabels(Product.KeyValue.Builder builderForValue)

public Product.Builder addProductLabels(Product.KeyValue.Builder builderForValue)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameter
Name Description
builderForValue Product.KeyValue.Builder
Returns
Type Description
Product.Builder

addProductLabels(int index, Product.KeyValue value)

public Product.Builder addProductLabels(int index, Product.KeyValue value)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameters
Name Description
index int
value Product.KeyValue
Returns
Type Description
Product.Builder

addProductLabels(int index, Product.KeyValue.Builder builderForValue)

public Product.Builder addProductLabels(int index, Product.KeyValue.Builder builderForValue)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameters
Name Description
index int
builderForValue Product.KeyValue.Builder
Returns
Type Description
Product.Builder

addProductLabelsBuilder()

public Product.KeyValue.Builder addProductLabelsBuilder()

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Returns
Type Description
Product.KeyValue.Builder

addProductLabelsBuilder(int index)

public Product.KeyValue.Builder addProductLabelsBuilder(int index)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameter
Name Description
index int
Returns
Type Description
Product.KeyValue.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Product build()
Returns
Type Description
Product

buildPartial()

public Product buildPartial()
Returns
Type Description
Product

clear()

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

clearDescription()

public Product.Builder clearDescription()

User-provided metadata to be stored with this product. Must be at most 4096 characters long.

string description = 3;

Returns
Type Description
Product.Builder

This builder for chaining.

clearDisplayName()

public Product.Builder clearDisplayName()

The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.

string display_name = 2;

Returns
Type Description
Product.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearName()

public Product.Builder clearName()

The resource name of the product.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

This field is ignored when creating a product.

string name = 1;

Returns
Type Description
Product.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearProductCategory()

public Product.Builder clearProductCategory()

Immutable. The category for the product identified by the reference image. This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products.

string product_category = 4 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
Product.Builder

This builder for chaining.

clearProductLabels()

public Product.Builder clearProductLabels()

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Returns
Type Description
Product.Builder

clone()

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

getDefaultInstanceForType()

public Product getDefaultInstanceForType()
Returns
Type Description
Product

getDescription()

public String getDescription()

User-provided metadata to be stored with this product. Must be at most 4096 characters long.

string description = 3;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

User-provided metadata to be stored with this product. Must be at most 4096 characters long.

string description = 3;

Returns
Type Description
ByteString

The bytes for description.

getDescriptorForType()

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

getDisplayName()

public String getDisplayName()

The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.

string display_name = 2;

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.

string display_name = 2;

Returns
Type Description
ByteString

The bytes for displayName.

getName()

public String getName()

The resource name of the product.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

This field is ignored when creating a product.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The resource name of the product.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

This field is ignored when creating a product.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getProductCategory()

public String getProductCategory()

Immutable. The category for the product identified by the reference image. This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products.

string product_category = 4 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
String

The productCategory.

getProductCategoryBytes()

public ByteString getProductCategoryBytes()

Immutable. The category for the product identified by the reference image. This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products.

string product_category = 4 [(.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
ByteString

The bytes for productCategory.

getProductLabels(int index)

public Product.KeyValue getProductLabels(int index)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameter
Name Description
index int
Returns
Type Description
Product.KeyValue

getProductLabelsBuilder(int index)

public Product.KeyValue.Builder getProductLabelsBuilder(int index)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameter
Name Description
index int
Returns
Type Description
Product.KeyValue.Builder

getProductLabelsBuilderList()

public List<Product.KeyValue.Builder> getProductLabelsBuilderList()

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Returns
Type Description
List<Builder>

getProductLabelsCount()

public int getProductLabelsCount()

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Returns
Type Description
int

getProductLabelsList()

public List<Product.KeyValue> getProductLabelsList()

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Returns
Type Description
List<KeyValue>

getProductLabelsOrBuilder(int index)

public Product.KeyValueOrBuilder getProductLabelsOrBuilder(int index)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameter
Name Description
index int
Returns
Type Description
Product.KeyValueOrBuilder

getProductLabelsOrBuilderList()

public List<? extends Product.KeyValueOrBuilder> getProductLabelsOrBuilderList()

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Returns
Type Description
List<? extends com.google.cloud.vision.v1p3beta1.Product.KeyValueOrBuilder>

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Product other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

removeProductLabels(int index)

public Product.Builder removeProductLabels(int index)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameter
Name Description
index int
Returns
Type Description
Product.Builder

setDescription(String value)

public Product.Builder setDescription(String value)

User-provided metadata to be stored with this product. Must be at most 4096 characters long.

string description = 3;

Parameter
Name Description
value String

The description to set.

Returns
Type Description
Product.Builder

This builder for chaining.

setDescriptionBytes(ByteString value)

public Product.Builder setDescriptionBytes(ByteString value)

User-provided metadata to be stored with this product. Must be at most 4096 characters long.

string description = 3;

Parameter
Name Description
value ByteString

The bytes for description to set.

Returns
Type Description
Product.Builder

This builder for chaining.

setDisplayName(String value)

public Product.Builder setDisplayName(String value)

The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.

string display_name = 2;

Parameter
Name Description
value String

The displayName to set.

Returns
Type Description
Product.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public Product.Builder setDisplayNameBytes(ByteString value)

The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.

string display_name = 2;

Parameter
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
Product.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setName(String value)

public Product.Builder setName(String value)

The resource name of the product.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

This field is ignored when creating a product.

string name = 1;

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Product.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Product.Builder setNameBytes(ByteString value)

The resource name of the product.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

This field is ignored when creating a product.

string name = 1;

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Product.Builder

This builder for chaining.

setProductCategory(String value)

public Product.Builder setProductCategory(String value)

Immutable. The category for the product identified by the reference image. This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products.

string product_category = 4 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value String

The productCategory to set.

Returns
Type Description
Product.Builder

This builder for chaining.

setProductCategoryBytes(ByteString value)

public Product.Builder setProductCategoryBytes(ByteString value)

Immutable. The category for the product identified by the reference image. This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products.

string product_category = 4 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
Name Description
value ByteString

The bytes for productCategory to set.

Returns
Type Description
Product.Builder

This builder for chaining.

setProductLabels(int index, Product.KeyValue value)

public Product.Builder setProductLabels(int index, Product.KeyValue value)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameters
Name Description
index int
value Product.KeyValue
Returns
Type Description
Product.Builder

setProductLabels(int index, Product.KeyValue.Builder builderForValue)

public Product.Builder setProductLabels(int index, Product.KeyValue.Builder builderForValue)

Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.

Note that integer values can be provided as strings, e.g. "1199". Only strings with integer values can match a range-based restriction which is to be supported soon.

Multiple values can be assigned to the same key. One product may have up to 100 product_labels.

repeated .google.cloud.vision.v1p3beta1.Product.KeyValue product_labels = 5;

Parameters
Name Description
index int
builderForValue Product.KeyValue.Builder
Returns
Type Description
Product.Builder

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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