Class ProductCatalogItem (0.10.4)

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
TypeDescription
int

CANONICAL_PRODUCT_URI_FIELD_NUMBER

public static final int CANONICAL_PRODUCT_URI_FIELD_NUMBER
Field Value
TypeDescription
int

COSTS_FIELD_NUMBER

public static final int COSTS_FIELD_NUMBER
Field Value
TypeDescription
int

CURRENCY_CODE_FIELD_NUMBER

public static final int CURRENCY_CODE_FIELD_NUMBER
Field Value
TypeDescription
int

EXACT_PRICE_FIELD_NUMBER

public static final int EXACT_PRICE_FIELD_NUMBER
Field Value
TypeDescription
int

IMAGES_FIELD_NUMBER

public static final int IMAGES_FIELD_NUMBER
Field Value
TypeDescription
int

PRICE_RANGE_FIELD_NUMBER

public static final int PRICE_RANGE_FIELD_NUMBER
Field Value
TypeDescription
int

STOCK_STATE_FIELD_NUMBER

public static final int STOCK_STATE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static ProductCatalogItem getDefaultInstance()
Returns
TypeDescription
ProductCatalogItem

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static ProductCatalogItem.Builder newBuilder()
Returns
TypeDescription
ProductCatalogItem.Builder

newBuilder(ProductCatalogItem prototype)

public static ProductCatalogItem.Builder newBuilder(ProductCatalogItem prototype)
Parameter
NameDescription
prototypeProductCatalogItem
Returns
TypeDescription
ProductCatalogItem.Builder

parseDelimitedFrom(InputStream input)

public static ProductCatalogItem parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ProductCatalogItem parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static ProductCatalogItem parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ProductCatalogItem parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ProductCatalogItem parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ProductCatalogItem parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ProductCatalogItem parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ProductCatalogItem parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static ProductCatalogItem parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ProductCatalogItem parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static ProductCatalogItem parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ProductCatalogItem parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProductCatalogItem
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<ProductCatalogItem> parser()
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getAvailableQuantity()

public long getAvailableQuantity()

Optional. The available quantity of the item.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for canonicalProductUri.

getCosts()

public Map<String,Float> getCosts()

Use #getCostsMap() instead.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
keyString
defaultValuefloat
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for currencyCode.

getDefaultInstanceForType()

public ProductCatalogItem getDefaultInstanceForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
List<? extends com.google.cloud.recommendationengine.v1beta1.ImageOrBuilder>

getParserForType()

public Parser<ProductCatalogItem> getParserForType()
Returns
TypeDescription
Parser<ProductCatalogItem>
Overrides

getPriceCase()

public ProductCatalogItem.PriceCase getPriceCase()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ProductCatalogItem.PriceRangeOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
int

The enum numeric value on the wire for stockState.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hasExactPrice()

public boolean hasExactPrice()

Optional. The exact product price.

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

Returns
TypeDescription
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
TypeDescription
boolean

Whether the priceRange field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public ProductCatalogItem.Builder newBuilderForType()
Returns
TypeDescription
ProductCatalogItem.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ProductCatalogItem.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
ProductCatalogItem.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public ProductCatalogItem.Builder toBuilder()
Returns
TypeDescription
ProductCatalogItem.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException