Class ProductDetail.Builder (0.10.1)

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public ProductDetail.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
ProductDetail.Builder
Overrides

build()

public ProductDetail build()
Returns
TypeDescription
ProductDetail

buildPartial()

public ProductDetail buildPartial()
Returns
TypeDescription
ProductDetail

clear()

public ProductDetail.Builder clear()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ProductDetail.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public ProductDetail.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ProductDetail.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public ProductDetail.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ProductDetail.Builder

This builder for chaining.

clone()

public ProductDetail.Builder clone()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for currencyCode.

getDefaultInstanceForType()

public ProductDetail getDefaultInstanceForType()
Returns
TypeDescription
ProductDetail

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the itemAttributes field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(ProductDetail other)

public ProductDetail.Builder mergeFrom(ProductDetail other)
Parameter
NameDescription
otherProductDetail
Returns
TypeDescription
ProductDetail.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ProductDetail.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ProductDetail.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public ProductDetail.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueFeatureMap
Returns
TypeDescription
ProductDetail.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final ProductDetail.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueint

The availableQuantity to set.

Returns
TypeDescription
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
NameDescription
valueString

The currencyCode to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for currencyCode to set.

Returns
TypeDescription
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
NameDescription
valuefloat

The displayPrice to set.

Returns
TypeDescription
ProductDetail.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public ProductDetail.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The id to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for id to set.

Returns
TypeDescription
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
NameDescription
valueFeatureMap
Returns
TypeDescription
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
NameDescription
builderForValueFeatureMap.Builder
Returns
TypeDescription
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
NameDescription
valuefloat

The originalPrice to set.

Returns
TypeDescription
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
NameDescription
valueint

The quantity to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueProductCatalogItem.StockState

The stockState to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
ProductDetail.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final ProductDetail.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
ProductDetail.Builder
Overrides