Class CatalogItem (0.54.0)

public final class CatalogItem extends GeneratedMessageV3 implements CatalogItemOrBuilder

CatalogItem captures all metadata information of items to be recommended.

Protobuf type google.cloud.recommendationengine.v1beta1.CatalogItem

Static Fields

CATEGORY_HIERARCHIES_FIELD_NUMBER

public static final int CATEGORY_HIERARCHIES_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
Type Description
int

ITEM_ATTRIBUTES_FIELD_NUMBER

public static final int ITEM_ATTRIBUTES_FIELD_NUMBER
Field Value
Type Description
int

ITEM_GROUP_ID_FIELD_NUMBER

public static final int ITEM_GROUP_ID_FIELD_NUMBER
Field Value
Type Description
int

LANGUAGE_CODE_FIELD_NUMBER

public static final int LANGUAGE_CODE_FIELD_NUMBER
Field Value
Type Description
int

PRODUCT_METADATA_FIELD_NUMBER

public static final int PRODUCT_METADATA_FIELD_NUMBER
Field Value
Type Description
int

TAGS_FIELD_NUMBER

public static final int TAGS_FIELD_NUMBER
Field Value
Type Description
int

TITLE_FIELD_NUMBER

public static final int TITLE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CatalogItem getDefaultInstance()
Returns
Type Description
CatalogItem

getDescriptor()

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

newBuilder()

public static CatalogItem.Builder newBuilder()
Returns
Type Description
CatalogItem.Builder

newBuilder(CatalogItem prototype)

public static CatalogItem.Builder newBuilder(CatalogItem prototype)
Parameter
Name Description
prototype CatalogItem
Returns
Type Description
CatalogItem.Builder

parseDelimitedFrom(InputStream input)

public static CatalogItem parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CatalogItem
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CatalogItem parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CatalogItem
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static CatalogItem parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
CatalogItem
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CatalogItem parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CatalogItem
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CatalogItem parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
CatalogItem
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CatalogItem parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CatalogItem
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CatalogItem parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CatalogItem
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CatalogItem parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CatalogItem
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static CatalogItem parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CatalogItem
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CatalogItem parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CatalogItem
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static CatalogItem parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CatalogItem
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CatalogItem parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CatalogItem
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<CatalogItem> parser()
Returns
Type Description
Parser<CatalogItem>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCategoryHierarchies(int index)

public CatalogItem.CategoryHierarchy getCategoryHierarchies(int index)

Required. Catalog item categories. This field is repeated for supporting one catalog item belonging to several parallel category hierarchies.

For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as:

  "categoryHierarchies": [
    { "categories": ["Shoes &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
CatalogItem.CategoryHierarchy

getCategoryHierarchiesCount()

public int getCategoryHierarchiesCount()

Required. Catalog item categories. This field is repeated for supporting one catalog item belonging to several parallel category hierarchies.

For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as:

  "categoryHierarchies": [
    { "categories": ["Shoes &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

getCategoryHierarchiesList()

public List<CatalogItem.CategoryHierarchy> getCategoryHierarchiesList()

Required. Catalog item categories. This field is repeated for supporting one catalog item belonging to several parallel category hierarchies.

For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as:

  "categoryHierarchies": [
    { "categories": ["Shoes &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<CategoryHierarchy>

getCategoryHierarchiesOrBuilder(int index)

public CatalogItem.CategoryHierarchyOrBuilder getCategoryHierarchiesOrBuilder(int index)

Required. Catalog item categories. This field is repeated for supporting one catalog item belonging to several parallel category hierarchies.

For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as:

  "categoryHierarchies": [
    { "categories": ["Shoes &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
CatalogItem.CategoryHierarchyOrBuilder

getCategoryHierarchiesOrBuilderList()

public List<? extends CatalogItem.CategoryHierarchyOrBuilder> getCategoryHierarchiesOrBuilderList()

Required. Catalog item categories. This field is repeated for supporting one catalog item belonging to several parallel category hierarchies.

For example, if a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented as:

  "categoryHierarchies": [
    { "categories": ["Shoes &amp; Accessories", "Shoes"]},
    { "categories": ["Sports &amp; Fitness", "Athletic Clothing", "Shoes"] }
  ]

repeated .google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchy category_hierarchies = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<? extends com.google.cloud.recommendationengine.v1beta1.CatalogItem.CategoryHierarchyOrBuilder>

getDefaultInstanceForType()

public CatalogItem getDefaultInstanceForType()
Returns
Type Description
CatalogItem

getDescription()

public String getDescription()

Optional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB.

string description = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Optional. Catalog item description. UTF-8 encoded string with a length limit of 5 KiB.

string description = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for description.

getId()

public String getId()

Required. Catalog item identifier. UTF-8 encoded string with a length limit of 128 bytes.

This id must be unique among all catalog items within the same catalog. It should also be used when logging user events in order for the user events to be joined with the Catalog.

string id = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The id.

getIdBytes()

public ByteString getIdBytes()

Required. Catalog item identifier. UTF-8 encoded string with a length limit of 128 bytes.

This id must be unique among all catalog items within the same catalog. It should also be used when logging user events in order for the user events to be joined with the Catalog.

string id = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for id.

getItemAttributes()

public FeatureMap getItemAttributes()

Optional. Highly encouraged. Extra catalog item attributes to be included in the recommendation model. For example, for retail products, this could include the store name, vendor, style, color, etc. These are very strong signals for recommendation model, thus we highly recommend providing the item attributes here.

.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
FeatureMap

The itemAttributes.

getItemAttributesOrBuilder()

public FeatureMapOrBuilder getItemAttributesOrBuilder()

Optional. Highly encouraged. Extra catalog item attributes to be included in the recommendation model. For example, for retail products, this could include the store name, vendor, style, color, etc. These are very strong signals for recommendation model, thus we highly recommend providing the item attributes here.

.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
FeatureMapOrBuilder

getItemGroupId()

public String getItemGroupId()

Optional. Variant group identifier for prediction results. UTF-8 encoded string with a length limit of 128 bytes.

This field must be enabled before it can be used. Learn more.

string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The itemGroupId.

getItemGroupIdBytes()

public ByteString getItemGroupIdBytes()

Optional. Variant group identifier for prediction results. UTF-8 encoded string with a length limit of 128 bytes.

This field must be enabled before it can be used. Learn more.

string item_group_id = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for itemGroupId.

getLanguageCode()

public String getLanguageCode()

Optional. Language of the title/description/item_attributes. Use language tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact your Google account manager.

string language_code = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The languageCode.

getLanguageCodeBytes()

public ByteString getLanguageCodeBytes()

Optional. Language of the title/description/item_attributes. Use language tags defined by BCP 47. https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Our supported language codes include 'en', 'es', 'fr', 'de', 'ar', 'fa', 'zh', 'ja', 'ko', 'sv', 'ro', 'nl'. For other languages, contact your Google account manager.

string language_code = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for languageCode.

getParserForType()

public Parser<CatalogItem> getParserForType()
Returns
Type Description
Parser<CatalogItem>
Overrides

getProductMetadata()

public ProductCatalogItem getProductMetadata()

Optional. Metadata specific to retail products.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProductCatalogItem

The productMetadata.

getProductMetadataOrBuilder()

public ProductCatalogItemOrBuilder getProductMetadataOrBuilder()

Optional. Metadata specific to retail products.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProductCatalogItemOrBuilder

getRecommendationTypeCase()

public CatalogItem.RecommendationTypeCase getRecommendationTypeCase()
Returns
Type Description
CatalogItem.RecommendationTypeCase

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getTags(int index)

public String getTags(int index)

Optional. Filtering tags associated with the catalog item. Each tag should be a UTF-8 encoded string with a length limit of 1 KiB.

This tag can be used for filtering recommendation results by passing the tag as part of the predict request filter.

repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The tags at the given index.

getTagsBytes(int index)

public ByteString getTagsBytes(int index)

Optional. Filtering tags associated with the catalog item. Each tag should be a UTF-8 encoded string with a length limit of 1 KiB.

This tag can be used for filtering recommendation results by passing the tag as part of the predict request filter.

repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the tags at the given index.

getTagsCount()

public int getTagsCount()

Optional. Filtering tags associated with the catalog item. Each tag should be a UTF-8 encoded string with a length limit of 1 KiB.

This tag can be used for filtering recommendation results by passing the tag as part of the predict request filter.

repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The count of tags.

getTagsList()

public ProtocolStringList getTagsList()

Optional. Filtering tags associated with the catalog item. Each tag should be a UTF-8 encoded string with a length limit of 1 KiB.

This tag can be used for filtering recommendation results by passing the tag as part of the predict request filter.

repeated string tags = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProtocolStringList

A list containing the tags.

getTitle()

public String getTitle()

Required. Catalog item title. UTF-8 encoded string with a length limit of 1 KiB.

string title = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The title.

getTitleBytes()

public ByteString getTitleBytes()

Required. Catalog item title. UTF-8 encoded string with a length limit of 1 KiB.

string title = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for title.

hasItemAttributes()

public boolean hasItemAttributes()

Optional. Highly encouraged. Extra catalog item attributes to be included in the recommendation model. For example, for retail products, this could include the store name, vendor, style, color, etc. These are very strong signals for recommendation model, thus we highly recommend providing the item attributes here.

.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the itemAttributes field is set.

hasProductMetadata()

public boolean hasProductMetadata()

Optional. Metadata specific to retail products.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem product_metadata = 10 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the productMetadata field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public CatalogItem.Builder newBuilderForType()
Returns
Type Description
CatalogItem.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CatalogItem.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CatalogItem.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public CatalogItem.Builder toBuilder()
Returns
Type Description
CatalogItem.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException