Class Product.Builder (3.38.0)

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

A Product contains ReferenceImages.

Protobuf type google.cloud.vision.v1.Product

Implements

ProductOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.vision.v1.Product.KeyValue>
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameter
NameDescription
valueProduct.KeyValue
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameter
NameDescription
builderForValueProduct.KeyValue.Builder
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameters
NameDescription
indexint
valueProduct.KeyValue
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameters
NameDescription
indexint
builderForValueProduct.KeyValue.Builder
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Product.KeyValue.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Product build()
Returns
TypeDescription
Product

buildPartial()

public Product buildPartial()
Returns
TypeDescription
Product

clear()

public Product.Builder clear()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
Product.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearProductCategory()

public Product.Builder clearProductCategory()

Immutable. The category for the product identified by the reference image. This should be one of "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". 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
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Returns
TypeDescription
Product.Builder

clone()

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

getDefaultInstanceForType()

public Product getDefaultInstanceForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for description.

getDescriptorForType()

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

The bytes for name.

getProductCategory()

public String getProductCategory()

Immutable. The category for the product identified by the reference image. This should be one of "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". 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
TypeDescription
String

The productCategory.

getProductCategoryBytes()

public ByteString getProductCategoryBytes()

Immutable. The category for the product identified by the reference image. This should be one of "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". 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
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Returns
TypeDescription
List<? extends com.google.cloud.vision.v1.Product.KeyValueOrBuilder>

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Product other)

public Product.Builder mergeFrom(Product other)
Parameter
NameDescription
otherProduct
Returns
TypeDescription
Product.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Product.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

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

The description to set.

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

The bytes for description to set.

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

The displayName to set.

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

The bytes for displayName to set.

Returns
TypeDescription
Product.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

The name to set.

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

The bytes for name to set.

Returns
TypeDescription
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 one of "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". 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
NameDescription
valueString

The productCategory to set.

Returns
TypeDescription
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 one of "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1" or "general-v1". 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
NameDescription
valueByteString

The bytes for productCategory to set.

Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameters
NameDescription
indexint
valueProduct.KeyValue
Returns
TypeDescription
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 500 product_labels.

Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.

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

Parameters
NameDescription
indexint
builderForValueProduct.KeyValue.Builder
Returns
TypeDescription
Product.Builder

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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