Class ProductDetail.Builder (0.55.0)

public static final class ProductDetail.Builder extends GeneratedMessageV3.Builder<ProductDetail.Builder> implements ProductDetailOrBuilder

Detailed product information associated with a user event.

Protobuf type google.cloud.recommendationengine.v1beta1.ProductDetail

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ProductDetail.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ProductDetail.Builder
Overrides

build()

public ProductDetail build()
Returns
Type Description
ProductDetail

buildPartial()

public ProductDetail buildPartial()
Returns
Type Description
ProductDetail

clear()

public ProductDetail.Builder clear()
Returns
Type Description
ProductDetail.Builder
Overrides

clearAvailableQuantity()

public ProductDetail.Builder 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
Type Description
ProductDetail.Builder

This builder for chaining.

clearCurrencyCode()

public ProductDetail.Builder 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
Type Description
ProductDetail.Builder

This builder for chaining.

clearDisplayPrice()

public ProductDetail.Builder 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
Type Description
ProductDetail.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public ProductDetail.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
ProductDetail.Builder
Overrides

clearId()

public ProductDetail.Builder 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
Type Description
ProductDetail.Builder

This builder for chaining.

clearItemAttributes()

public ProductDetail.Builder 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];

Returns
Type Description
ProductDetail.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public ProductDetail.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
ProductDetail.Builder
Overrides

clearOriginalPrice()

public ProductDetail.Builder 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
Type Description
ProductDetail.Builder

This builder for chaining.

clearQuantity()

public ProductDetail.Builder 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
Type Description
ProductDetail.Builder

This builder for chaining.

clearStockState()

public ProductDetail.Builder 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
Type Description
ProductDetail.Builder

This builder for chaining.

clone()

public ProductDetail.Builder clone()
Returns
Type Description
ProductDetail.Builder
Overrides

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];

Returns
Type Description
int

The availableQuantity.

getCurrencyCode()

public String 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];

Returns
Type Description
String

The currencyCode.

getCurrencyCodeBytes()

public 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];

Returns
Type Description
ByteString

The bytes for currencyCode.

getDefaultInstanceForType()

public ProductDetail getDefaultInstanceForType()
Returns
Type Description
ProductDetail

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

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];

Returns
Type Description
float

The displayPrice.

getId()

public String getId()

Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.

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

Returns
Type Description
String

The id.

getIdBytes()

public 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];

Returns
Type Description
ByteString

The bytes for id.

getItemAttributes()

public FeatureMap 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];

Returns
Type Description
FeatureMap

The itemAttributes.

getItemAttributesBuilder()

public FeatureMap.Builder 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];

Returns
Type Description
FeatureMap.Builder

getItemAttributesOrBuilder()

public FeatureMapOrBuilder 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];

Returns
Type Description
FeatureMapOrBuilder

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];

Returns
Type Description
float

The originalPrice.

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];

Returns
Type Description
int

The quantity.

getStockState()

public ProductCatalogItem.StockState 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];

Returns
Type Description
ProductCatalogItem.StockState

The stockState.

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];

Returns
Type Description
int

The enum numeric value on the wire for stockState.

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];

Returns
Type Description
boolean

Whether the itemAttributes field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ProductDetail other)

public ProductDetail.Builder mergeFrom(ProductDetail other)
Parameter
Name Description
other ProductDetail
Returns
Type Description
ProductDetail.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ProductDetail.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ProductDetail.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public ProductDetail.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
ProductDetail.Builder
Overrides

mergeItemAttributes(FeatureMap value)

public ProductDetail.Builder mergeItemAttributes(FeatureMap value)

Optional. Extra features associated with a product in the user event.

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

Parameter
Name Description
value FeatureMap
Returns
Type Description
ProductDetail.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ProductDetail.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ProductDetail.Builder
Overrides

setAvailableQuantity(int value)

public ProductDetail.Builder setAvailableQuantity(int value)

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];

Parameter
Name Description
value int

The availableQuantity to set.

Returns
Type Description
ProductDetail.Builder

This builder for chaining.

setCurrencyCode(String value)

public ProductDetail.Builder setCurrencyCode(String value)

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];

Parameter
Name Description
value String

The currencyCode to set.

Returns
Type Description
ProductDetail.Builder

This builder for chaining.

setCurrencyCodeBytes(ByteString value)

public ProductDetail.Builder setCurrencyCodeBytes(ByteString value)

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];

Parameter
Name Description
value ByteString

The bytes for currencyCode to set.

Returns
Type Description
ProductDetail.Builder

This builder for chaining.

setDisplayPrice(float value)

public ProductDetail.Builder setDisplayPrice(float value)

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];

Parameter
Name Description
value float

The displayPrice to set.

Returns
Type Description
ProductDetail.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public ProductDetail.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
ProductDetail.Builder
Overrides

setId(String value)

public ProductDetail.Builder setId(String value)

Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.

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

Parameter
Name Description
value String

The id to set.

Returns
Type Description
ProductDetail.Builder

This builder for chaining.

setIdBytes(ByteString value)

public ProductDetail.Builder setIdBytes(ByteString value)

Required. Catalog item ID. UTF-8 encoded string with a length limit of 128 characters.

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

Parameter
Name Description
value ByteString

The bytes for id to set.

Returns
Type Description
ProductDetail.Builder

This builder for chaining.

setItemAttributes(FeatureMap value)

public ProductDetail.Builder setItemAttributes(FeatureMap value)

Optional. Extra features associated with a product in the user event.

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

Parameter
Name Description
value FeatureMap
Returns
Type Description
ProductDetail.Builder

setItemAttributes(FeatureMap.Builder builderForValue)

public ProductDetail.Builder setItemAttributes(FeatureMap.Builder builderForValue)

Optional. Extra features associated with a product in the user event.

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

Parameter
Name Description
builderForValue FeatureMap.Builder
Returns
Type Description
ProductDetail.Builder

setOriginalPrice(float value)

public ProductDetail.Builder setOriginalPrice(float value)

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];

Parameter
Name Description
value float

The originalPrice to set.

Returns
Type Description
ProductDetail.Builder

This builder for chaining.

setQuantity(int value)

public ProductDetail.Builder setQuantity(int value)

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];

Parameter
Name Description
value int

The quantity to set.

Returns
Type Description
ProductDetail.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public ProductDetail.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
ProductDetail.Builder
Overrides

setStockState(ProductCatalogItem.StockState value)

public ProductDetail.Builder setStockState(ProductCatalogItem.StockState value)

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];

Parameter
Name Description
value ProductCatalogItem.StockState

The stockState to set.

Returns
Type Description
ProductDetail.Builder

This builder for chaining.

setStockStateValue(int value)

public ProductDetail.Builder setStockStateValue(int value)

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];

Parameter
Name Description
value int

The enum numeric value on the wire for stockState to set.

Returns
Type Description
ProductDetail.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ProductDetail.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
ProductDetail.Builder
Overrides