Class ProductCatalogItem (0.49.0)

public final class ProductCatalogItem extends GeneratedMessageV3 implements ProductCatalogItemOrBuilder

ProductCatalogItem captures item metadata specific to retail products.

Protobuf type google.cloud.recommendationengine.v1beta1.ProductCatalogItem

Static Fields

AVAILABLE_QUANTITY_FIELD_NUMBER

public static final int AVAILABLE_QUANTITY_FIELD_NUMBER
Field Value
Type Description
int

CANONICAL_PRODUCT_URI_FIELD_NUMBER

public static final int CANONICAL_PRODUCT_URI_FIELD_NUMBER
Field Value
Type Description
int

COSTS_FIELD_NUMBER

public static final int COSTS_FIELD_NUMBER
Field Value
Type Description
int

CURRENCY_CODE_FIELD_NUMBER

public static final int CURRENCY_CODE_FIELD_NUMBER
Field Value
Type Description
int

EXACT_PRICE_FIELD_NUMBER

public static final int EXACT_PRICE_FIELD_NUMBER
Field Value
Type Description
int

IMAGES_FIELD_NUMBER

public static final int IMAGES_FIELD_NUMBER
Field Value
Type Description
int

PRICE_RANGE_FIELD_NUMBER

public static final int PRICE_RANGE_FIELD_NUMBER
Field Value
Type Description
int

STOCK_STATE_FIELD_NUMBER

public static final int STOCK_STATE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static ProductCatalogItem getDefaultInstance()
Returns
Type Description
ProductCatalogItem

getDescriptor()

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

newBuilder()

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

newBuilder(ProductCatalogItem prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

containsCosts(String key)

public boolean containsCosts(String key)

Optional. A map to pass the costs associated with the product.

For example: {"manufacturing": 45.5} The profit of selling this item is computed like so:

  • If 'exactPrice' is provided, profit = displayPrice - sum(costs)
  • If 'priceRange' is provided, profit = minPrice - sum(costs)

map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

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

getAvailableQuantity()

public long getAvailableQuantity()

Optional. The available quantity of the item.

int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
long

The availableQuantity.

getCanonicalProductUri()

public String getCanonicalProductUri()

Optional. Canonical URL directly linking to the item detail page with a length limit of 5 KiB..

string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The canonicalProductUri.

getCanonicalProductUriBytes()

public ByteString getCanonicalProductUriBytes()

Optional. Canonical URL directly linking to the item detail page with a length limit of 5 KiB..

string canonical_product_uri = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for canonicalProductUri.

getCosts() (deprecated)

public Map<String,Float> getCosts()

Use #getCostsMap() instead.

Returns
Type Description
Map<String,Float>

getCostsCount()

public int getCostsCount()

Optional. A map to pass the costs associated with the product.

For example: {"manufacturing": 45.5} The profit of selling this item is computed like so:

  • If 'exactPrice' is provided, profit = displayPrice - sum(costs)
  • If 'priceRange' is provided, profit = minPrice - sum(costs)

map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getCostsMap()

public Map<String,Float> getCostsMap()

Optional. A map to pass the costs associated with the product.

For example: {"manufacturing": 45.5} The profit of selling this item is computed like so:

  • If 'exactPrice' is provided, profit = displayPrice - sum(costs)
  • If 'priceRange' is provided, profit = minPrice - sum(costs)

map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Map<String,Float>

getCostsOrDefault(String key, float defaultValue)

public float getCostsOrDefault(String key, float defaultValue)

Optional. A map to pass the costs associated with the product.

For example: {"manufacturing": 45.5} The profit of selling this item is computed like so:

  • If 'exactPrice' is provided, profit = displayPrice - sum(costs)
  • If 'priceRange' is provided, profit = minPrice - sum(costs)

map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
key String
defaultValue float
Returns
Type Description
float

getCostsOrThrow(String key)

public float getCostsOrThrow(String key)

Optional. A map to pass the costs associated with the product.

For example: {"manufacturing": 45.5} The profit of selling this item is computed like so:

  • If 'exactPrice' is provided, profit = displayPrice - sum(costs)
  • If 'priceRange' is provided, profit = minPrice - sum(costs)

map<string, float> costs = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
float

getCurrencyCode()

public String getCurrencyCode()

Optional. Only required if the price is set. Currency code for price/costs. Use three-character ISO-4217 code.

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

Returns
Type Description
String

The currencyCode.

getCurrencyCodeBytes()

public ByteString getCurrencyCodeBytes()

Optional. Only required if the price is set. Currency code for price/costs. Use three-character ISO-4217 code.

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

Returns
Type Description
ByteString

The bytes for currencyCode.

getDefaultInstanceForType()

public ProductCatalogItem getDefaultInstanceForType()
Returns
Type Description
ProductCatalogItem

getExactPrice()

public ProductCatalogItem.ExactPrice getExactPrice()

Optional. The exact product price.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProductCatalogItem.ExactPrice

The exactPrice.

getExactPriceOrBuilder()

public ProductCatalogItem.ExactPriceOrBuilder getExactPriceOrBuilder()

Optional. The exact product price.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProductCatalogItem.ExactPriceOrBuilder

getImages(int index)

public Image getImages(int index)

Optional. Product images for the catalog item.

repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
Image

getImagesCount()

public int getImagesCount()

Optional. Product images for the catalog item.

repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getImagesList()

public List<Image> getImagesList()

Optional. Product images for the catalog item.

repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Image>

getImagesOrBuilder(int index)

public ImageOrBuilder getImagesOrBuilder(int index)

Optional. Product images for the catalog item.

repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
ImageOrBuilder

getImagesOrBuilderList()

public List<? extends ImageOrBuilder> getImagesOrBuilderList()

Optional. Product images for the catalog item.

repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL];

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

getParserForType()

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

getPriceCase()

public ProductCatalogItem.PriceCase getPriceCase()
Returns
Type Description
ProductCatalogItem.PriceCase

getPriceRange()

public ProductCatalogItem.PriceRange getPriceRange()

Optional. The product price range.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProductCatalogItem.PriceRange

The priceRange.

getPriceRangeOrBuilder()

public ProductCatalogItem.PriceRangeOrBuilder getPriceRangeOrBuilder()

Optional. The product price range.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProductCatalogItem.PriceRangeOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getStockState()

public ProductCatalogItem.StockState getStockState()

Optional. Online stock state of the catalog item. Default is IN_STOCK.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProductCatalogItem.StockState

The stockState.

getStockStateValue()

public int getStockStateValue()

Optional. Online stock state of the catalog item. Default is IN_STOCK.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The enum numeric value on the wire for stockState.

hasExactPrice()

public boolean hasExactPrice()

Optional. The exact product price.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the exactPrice field is set.

hasPriceRange()

public boolean hasPriceRange()

Optional. The product price range.

.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.PriceRange price_range = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the priceRange field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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