Class ProductCatalogItem

  • All Implemented Interfaces:
    ProductCatalogItemOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class ProductCatalogItem
    extends com.google.protobuf.GeneratedMessageV3
    implements ProductCatalogItemOrBuilder
     ProductCatalogItem captures item metadata specific to retail products.
     
    Protobuf type google.cloud.recommendationengine.v1beta1.ProductCatalogItem
    See Also:
    Serialized Form
    • Field Detail

      • EXACT_PRICE_FIELD_NUMBER

        public static final int EXACT_PRICE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • PRICE_RANGE_FIELD_NUMBER

        public static final int PRICE_RANGE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • CURRENCY_CODE_FIELD_NUMBER

        public static final int CURRENCY_CODE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • STOCK_STATE_FIELD_NUMBER

        public static final int STOCK_STATE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • AVAILABLE_QUANTITY_FIELD_NUMBER

        public static final int AVAILABLE_QUANTITY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • CANONICAL_PRODUCT_URI_FIELD_NUMBER

        public static final int CANONICAL_PRODUCT_URI_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • hasExactPrice

        public boolean hasExactPrice()
         Optional. The exact product price.
         
        .google.cloud.recommendationengine.v1beta1.ProductCatalogItem.ExactPrice exact_price = 1 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        hasExactPrice in interface ProductCatalogItemOrBuilder
        Returns:
        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];
        Specified by:
        hasPriceRange in interface ProductCatalogItemOrBuilder
        Returns:
        Whether the priceRange field is set.
      • getCostsCount

        public int getCostsCount()
        Description copied from interface: ProductCatalogItemOrBuilder
         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];
        Specified by:
        getCostsCount in interface ProductCatalogItemOrBuilder
      • containsCosts

        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];
        Specified by:
        containsCosts in interface ProductCatalogItemOrBuilder
      • 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];
        Specified by:
        getCostsMap in interface ProductCatalogItemOrBuilder
      • getCostsOrDefault

        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];
        Specified by:
        getCostsOrDefault in interface ProductCatalogItemOrBuilder
      • getCostsOrThrow

        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];
        Specified by:
        getCostsOrThrow in interface ProductCatalogItemOrBuilder
      • 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];
        Specified by:
        getCurrencyCode in interface ProductCatalogItemOrBuilder
        Returns:
        The currencyCode.
      • getCurrencyCodeBytes

        public com.google.protobuf.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];
        Specified by:
        getCurrencyCodeBytes in interface ProductCatalogItemOrBuilder
        Returns:
        The bytes for currencyCode.
      • 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];
        Specified by:
        getStockStateValue in interface ProductCatalogItemOrBuilder
        Returns:
        The enum numeric value on the wire for stockState.
      • 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];
        Specified by:
        getStockState in interface ProductCatalogItemOrBuilder
        Returns:
        The stockState.
      • getAvailableQuantity

        public long getAvailableQuantity()
         Optional. The available quantity of the item.
         
        int64 available_quantity = 6 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getAvailableQuantity in interface ProductCatalogItemOrBuilder
        Returns:
        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];
        Specified by:
        getCanonicalProductUri in interface ProductCatalogItemOrBuilder
        Returns:
        The canonicalProductUri.
      • getCanonicalProductUriBytes

        public com.google.protobuf.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];
        Specified by:
        getCanonicalProductUriBytes in interface ProductCatalogItemOrBuilder
        Returns:
        The bytes for canonicalProductUri.
      • 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];
        Specified by:
        getImagesList in interface ProductCatalogItemOrBuilder
      • getImagesCount

        public int getImagesCount()
         Optional. Product images for the catalog item.
         
        repeated .google.cloud.recommendationengine.v1beta1.Image images = 8 [(.google.api.field_behavior) = OPTIONAL];
        Specified by:
        getImagesCount in interface ProductCatalogItemOrBuilder
      • getImages

        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];
        Specified by:
        getImages in interface ProductCatalogItemOrBuilder
      • getImagesOrBuilder

        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];
        Specified by:
        getImagesOrBuilder in interface ProductCatalogItemOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static ProductCatalogItem parseFrom​(ByteBuffer data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProductCatalogItem parseFrom​(ByteBuffer data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProductCatalogItem parseFrom​(com.google.protobuf.ByteString data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProductCatalogItem parseFrom​(com.google.protobuf.ByteString data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProductCatalogItem parseFrom​(byte[] data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProductCatalogItem parseFrom​(byte[] data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ProductCatalogItem parseFrom​(com.google.protobuf.CodedInputStream input,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws IOException
        Throws:
        IOException
      • newBuilderForType

        public ProductCatalogItem.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public ProductCatalogItem.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected ProductCatalogItem.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<ProductCatalogItem> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public ProductCatalogItem getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder