Package com.google.cloud.vision.v1
Class ProductSearchParams.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ProductSearchParams.Builder>
com.google.cloud.vision.v1.ProductSearchParams.Builder
- All Implemented Interfaces:
ProductSearchParamsOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- ProductSearchParams
public static final class ProductSearchParams.Builder
extends com.google.protobuf.GeneratedMessage.Builder<ProductSearchParams.Builder>
implements ProductSearchParamsOrBuilder
Parameters for a product search request.Protobuf type
google.cloud.vision.v1.ProductSearchParams-
Method Summary
Modifier and TypeMethodDescriptionaddAllProductCategories(Iterable<String> values) The list of product categories to search in.addProductCategories(String value) The list of product categories to search in.addProductCategoriesBytes(com.google.protobuf.ByteString value) The list of product categories to search in.build()clear()The bounding polygon around the area of interest in the image.The filtering expression.The list of product categories to search in.The resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images.The bounding polygon around the area of interest in the image.The bounding polygon around the area of interest in the image.The bounding polygon around the area of interest in the image.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorThe filtering expression.com.google.protobuf.ByteStringThe filtering expression.getProductCategories(int index) The list of product categories to search in.com.google.protobuf.ByteStringgetProductCategoriesBytes(int index) The list of product categories to search in.intThe list of product categories to search in.com.google.protobuf.ProtocolStringListThe list of product categories to search in.The resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images.com.google.protobuf.ByteStringThe resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images.booleanThe bounding polygon around the area of interest in the image.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeBoundingPoly(BoundingPoly value) The bounding polygon around the area of interest in the image.mergeFrom(ProductSearchParams other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setBoundingPoly(BoundingPoly value) The bounding polygon around the area of interest in the image.setBoundingPoly(BoundingPoly.Builder builderForValue) The bounding polygon around the area of interest in the image.The filtering expression.setFilterBytes(com.google.protobuf.ByteString value) The filtering expression.setProductCategories(int index, String value) The list of product categories to search in.setProductSet(String value) The resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images.setProductSetBytes(com.google.protobuf.ByteString value) The resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<ProductSearchParams.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<ProductSearchParams.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<ProductSearchParams.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<ProductSearchParams.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<ProductSearchParams.Builder>
-
mergeFrom
public ProductSearchParams.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<ProductSearchParams.Builder>- Throws:
IOException
-
hasBoundingPoly
public boolean hasBoundingPoly()The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
.google.cloud.vision.v1.BoundingPoly bounding_poly = 9;- Specified by:
hasBoundingPolyin interfaceProductSearchParamsOrBuilder- Returns:
- Whether the boundingPoly field is set.
-
getBoundingPoly
The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
.google.cloud.vision.v1.BoundingPoly bounding_poly = 9;- Specified by:
getBoundingPolyin interfaceProductSearchParamsOrBuilder- Returns:
- The boundingPoly.
-
setBoundingPoly
The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
.google.cloud.vision.v1.BoundingPoly bounding_poly = 9; -
setBoundingPoly
The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
.google.cloud.vision.v1.BoundingPoly bounding_poly = 9; -
mergeBoundingPoly
The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
.google.cloud.vision.v1.BoundingPoly bounding_poly = 9; -
clearBoundingPoly
The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
.google.cloud.vision.v1.BoundingPoly bounding_poly = 9; -
getBoundingPolyBuilder
The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
.google.cloud.vision.v1.BoundingPoly bounding_poly = 9; -
getBoundingPolyOrBuilder
The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
.google.cloud.vision.v1.BoundingPoly bounding_poly = 9;- Specified by:
getBoundingPolyOrBuilderin interfaceProductSearchParamsOrBuilder
-
getProductSet
The resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
string product_set = 6 [(.google.api.resource_reference) = { ... }- Specified by:
getProductSetin interfaceProductSearchParamsOrBuilder- Returns:
- The productSet.
-
getProductSetBytes
public com.google.protobuf.ByteString getProductSetBytes()The resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
string product_set = 6 [(.google.api.resource_reference) = { ... }- Specified by:
getProductSetBytesin interfaceProductSearchParamsOrBuilder- Returns:
- The bytes for productSet.
-
setProductSet
The resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
string product_set = 6 [(.google.api.resource_reference) = { ... }- Parameters:
value- The productSet to set.- Returns:
- This builder for chaining.
-
clearProductSet
The resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
string product_set = 6 [(.google.api.resource_reference) = { ... }- Returns:
- This builder for chaining.
-
setProductSetBytes
The resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images. Format is: `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
string product_set = 6 [(.google.api.resource_reference) = { ... }- Parameters:
value- The bytes for productSet to set.- Returns:
- This builder for chaining.
-
getProductCategoriesList
public com.google.protobuf.ProtocolStringList getProductCategoriesList()The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.
repeated string product_categories = 7;- Specified by:
getProductCategoriesListin interfaceProductSearchParamsOrBuilder- Returns:
- A list containing the productCategories.
-
getProductCategoriesCount
public int getProductCategoriesCount()The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.
repeated string product_categories = 7;- Specified by:
getProductCategoriesCountin interfaceProductSearchParamsOrBuilder- Returns:
- The count of productCategories.
-
getProductCategories
The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.
repeated string product_categories = 7;- Specified by:
getProductCategoriesin interfaceProductSearchParamsOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The productCategories at the given index.
-
getProductCategoriesBytes
public com.google.protobuf.ByteString getProductCategoriesBytes(int index) The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.
repeated string product_categories = 7;- Specified by:
getProductCategoriesBytesin interfaceProductSearchParamsOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The bytes of the productCategories at the given index.
-
setProductCategories
The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.
repeated string product_categories = 7;- Parameters:
index- The index to set the value at.value- The productCategories to set.- Returns:
- This builder for chaining.
-
addProductCategories
The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.
repeated string product_categories = 7;- Parameters:
value- The productCategories to add.- Returns:
- This builder for chaining.
-
addAllProductCategories
The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.
repeated string product_categories = 7;- Parameters:
values- The productCategories to add.- Returns:
- This builder for chaining.
-
clearProductCategories
The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.
repeated string product_categories = 7;- Returns:
- This builder for chaining.
-
addProductCategoriesBytes
The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.
repeated string product_categories = 7;- Parameters:
value- The bytes of the productCategories to add.- Returns:
- This builder for chaining.
-
getFilter
The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value. For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='.
string filter = 8;- Specified by:
getFilterin interfaceProductSearchParamsOrBuilder- Returns:
- The filter.
-
getFilterBytes
public com.google.protobuf.ByteString getFilterBytes()The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value. For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='.
string filter = 8;- Specified by:
getFilterBytesin interfaceProductSearchParamsOrBuilder- Returns:
- The bytes for filter.
-
setFilter
The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value. For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='.
string filter = 8;- Parameters:
value- The filter to set.- Returns:
- This builder for chaining.
-
clearFilter
The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value. For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='.
string filter = 8;- Returns:
- This builder for chaining.
-
setFilterBytes
The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value. For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='.
string filter = 8;- Parameters:
value- The bytes for filter to set.- Returns:
- This builder for chaining.
-