Class ProductDetail.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ProductDetail.Builder>
com.google.cloud.recommendationengine.v1beta1.ProductDetail.Builder
- All Implemented Interfaces:
ProductDetailOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- ProductDetail
public static final class ProductDetail.Builder
extends com.google.protobuf.GeneratedMessage.Builder<ProductDetail.Builder>
implements ProductDetailOrBuilder
Detailed product information associated with a user event.Protobuf type
google.cloud.recommendationengine.v1beta1.ProductDetail-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Optional.Optional.Optional.clearId()Required.Optional.Optional.Optional.Optional.intOptional.Optional.com.google.protobuf.ByteStringOptional.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorfloatOptional.getId()Required.com.google.protobuf.ByteStringRequired.Optional.Optional.Optional.floatOptional.intOptional.Optional.intOptional.booleanOptional.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(ProductDetail other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeItemAttributes(FeatureMap value) Optional.setAvailableQuantity(int value) Optional.setCurrencyCode(String value) Optional.setCurrencyCodeBytes(com.google.protobuf.ByteString value) Optional.setDisplayPrice(float value) Optional.Required.setIdBytes(com.google.protobuf.ByteString value) Required.setItemAttributes(FeatureMap value) Optional.setItemAttributes(FeatureMap.Builder builderForValue) Optional.setOriginalPrice(float value) Optional.setQuantity(int value) Optional.Optional.setStockStateValue(int value) Optional.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<ProductDetail.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<ProductDetail.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<ProductDetail.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<ProductDetail.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<ProductDetail.Builder>
-
mergeFrom
public ProductDetail.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<ProductDetail.Builder>- Throws:
IOException
-
getId
Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.
string id = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getIdin interfaceProductDetailOrBuilder- Returns:
- The id.
-
getIdBytes
public com.google.protobuf.ByteString getIdBytes()Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.
string id = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getIdBytesin interfaceProductDetailOrBuilder- Returns:
- The bytes for id.
-
setId
Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.
string id = 1 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The id to set.- Returns:
- This builder for chaining.
-
clearId
Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.
string id = 1 [(.google.api.field_behavior) = REQUIRED];- Returns:
- This builder for chaining.
-
setIdBytes
Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.
string id = 1 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The bytes for id to set.- Returns:
- This builder for chaining.
-
getCurrencyCode
Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.
string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getCurrencyCodein interfaceProductDetailOrBuilder- Returns:
- The currencyCode.
-
getCurrencyCodeBytes
public com.google.protobuf.ByteString getCurrencyCodeBytes()Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.
string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getCurrencyCodeBytesin interfaceProductDetailOrBuilder- Returns:
- The bytes for currencyCode.
-
setCurrencyCode
Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.
string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The currencyCode to set.- Returns:
- This builder for chaining.
-
clearCurrencyCode
Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.
string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
setCurrencyCodeBytes
Optional. Currency code for price/costs. Use three-character ISO-4217 code. Required only if originalPrice or displayPrice is set.
string currency_code = 2 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The bytes for currencyCode to set.- Returns:
- This builder for chaining.
-
getOriginalPrice
public float getOriginalPrice()Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.
float original_price = 3 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getOriginalPricein interfaceProductDetailOrBuilder- Returns:
- The originalPrice.
-
setOriginalPrice
Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.
float original_price = 3 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The originalPrice to set.- Returns:
- This builder for chaining.
-
clearOriginalPrice
Optional. Original price of the product. If provided, this will override the original price in Catalog for this product.
float original_price = 3 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
getDisplayPrice
public float getDisplayPrice()Optional. Display price of the product (e.g. discounted price). If provided, this will override the display price in Catalog for this product.
float display_price = 4 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getDisplayPricein interfaceProductDetailOrBuilder- Returns:
- The displayPrice.
-
setDisplayPrice
Optional. Display price of the product (e.g. discounted price). If provided, this will override the display price in Catalog for this product.
float display_price = 4 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The displayPrice to set.- Returns:
- This builder for chaining.
-
clearDisplayPrice
Optional. Display price of the product (e.g. discounted price). If provided, this will override the display price in Catalog for this product.
float display_price = 4 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
getStockStateValue
public int getStockStateValue()Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.
.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getStockStateValuein interfaceProductDetailOrBuilder- Returns:
- The enum numeric value on the wire for stockState.
-
setStockStateValue
Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.
.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The enum numeric value on the wire for stockState to set.- Returns:
- This builder for chaining.
-
getStockState
Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.
.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getStockStatein interfaceProductDetailOrBuilder- Returns:
- The stockState.
-
setStockState
Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.
.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The stockState to set.- Returns:
- This builder for chaining.
-
clearStockState
Optional. Item stock state. If provided, this overrides the stock state in Catalog for items in this event.
.google.cloud.recommendationengine.v1beta1.ProductCatalogItem.StockState stock_state = 5 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
getQuantity
public int getQuantity()Optional. Quantity of the product associated with the user event. For example, this field will be 2 if two products are added to the shopping cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event types.
int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getQuantityin interfaceProductDetailOrBuilder- Returns:
- The quantity.
-
setQuantity
Optional. Quantity of the product associated with the user event. For example, this field will be 2 if two products are added to the shopping cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event types.
int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The quantity to set.- Returns:
- This builder for chaining.
-
clearQuantity
Optional. Quantity of the product associated with the user event. For example, this field will be 2 if two products are added to the shopping cart for `add-to-cart` event. Required for `add-to-cart`, `add-to-list`, `remove-from-cart`, `checkout-start`, `purchase-complete`, `refund` event types.
int32 quantity = 6 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
getAvailableQuantity
public int getAvailableQuantity()Optional. Quantity of the products in stock when a user event happens. Optional. If provided, this overrides the available quantity in Catalog for this event. and can only be set if `stock_status` is set to `IN_STOCK`. Note that if an item is out of stock, you must set the `stock_state` field to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not sufficient to mark the item out of stock.
int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getAvailableQuantityin interfaceProductDetailOrBuilder- Returns:
- The availableQuantity.
-
setAvailableQuantity
Optional. Quantity of the products in stock when a user event happens. Optional. If provided, this overrides the available quantity in Catalog for this event. and can only be set if `stock_status` is set to `IN_STOCK`. Note that if an item is out of stock, you must set the `stock_state` field to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not sufficient to mark the item out of stock.
int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The availableQuantity to set.- Returns:
- This builder for chaining.
-
clearAvailableQuantity
Optional. Quantity of the products in stock when a user event happens. Optional. If provided, this overrides the available quantity in Catalog for this event. and can only be set if `stock_status` is set to `IN_STOCK`. Note that if an item is out of stock, you must set the `stock_state` field to be `OUT_OF_STOCK`. Leaving this field unspecified / as zero is not sufficient to mark the item out of stock.
int32 available_quantity = 7 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
hasItemAttributes
public boolean hasItemAttributes()Optional. Extra features associated with a product in the user event.
.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
hasItemAttributesin interfaceProductDetailOrBuilder- Returns:
- Whether the itemAttributes field is set.
-
getItemAttributes
Optional. Extra features associated with a product in the user event.
.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getItemAttributesin interfaceProductDetailOrBuilder- Returns:
- The itemAttributes.
-
setItemAttributes
Optional. Extra features associated with a product in the user event.
.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; -
setItemAttributes
Optional. Extra features associated with a product in the user event.
.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; -
mergeItemAttributes
Optional. Extra features associated with a product in the user event.
.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; -
clearItemAttributes
Optional. Extra features associated with a product in the user event.
.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; -
getItemAttributesBuilder
Optional. Extra features associated with a product in the user event.
.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL]; -
getItemAttributesOrBuilder
Optional. Extra features associated with a product in the user event.
.google.cloud.recommendationengine.v1beta1.FeatureMap item_attributes = 8 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getItemAttributesOrBuilderin interfaceProductDetailOrBuilder
-