Class PriceInfo.Builder (2.44.0)

public static final class PriceInfo.Builder extends GeneratedMessageV3.Builder<PriceInfo.Builder> implements PriceInfoOrBuilder

The price information of a Product.

Protobuf type google.cloud.retail.v2beta.PriceInfo

Implements

PriceInfoOrBuilder

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public PriceInfo build()
Returns
Type Description
PriceInfo

buildPartial()

public PriceInfo buildPartial()
Returns
Type Description
PriceInfo

clear()

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

clearCost()

public PriceInfo.Builder clearCost()

The costs associated with the sale of a particular product. Used for gross profit reporting.

float cost = 4;

Returns
Type Description
PriceInfo.Builder

This builder for chaining.

clearCurrencyCode()

public PriceInfo.Builder clearCurrencyCode()

The 3-letter currency code defined in ISO 4217.

If this field is an unrecognizable currency code, an INVALID_ARGUMENT error is returned.

The Product.Type.VARIANT Products with the same Product.primary_product_id must share the same currency_code. Otherwise, a FAILED_PRECONDITION error is returned.

string currency_code = 1;

Returns
Type Description
PriceInfo.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearOriginalPrice()

public PriceInfo.Builder clearOriginalPrice()

Price of the product without any discount. If zero, by default set to be the price. If set, original_price should be greater than or equal to price, otherwise an INVALID_ARGUMENT error is thrown.

float original_price = 3;

Returns
Type Description
PriceInfo.Builder

This builder for chaining.

clearPrice()

public PriceInfo.Builder clearPrice()

Price of the product.

Google Merchant Center property price. Schema.org property Offer.price.

float price = 2;

Returns
Type Description
PriceInfo.Builder

This builder for chaining.

clearPriceEffectiveTime()

public PriceInfo.Builder clearPriceEffectiveTime()

The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_effective_time = 5;

Returns
Type Description
PriceInfo.Builder

clearPriceExpireTime()

public PriceInfo.Builder clearPriceExpireTime()

The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_expire_time = 6;

Returns
Type Description
PriceInfo.Builder

clearPriceRange()

public PriceInfo.Builder clearPriceRange()

Output only. The price range of all the child Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY Product. Only populated for Product.Type.PRIMARY Products.

Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.

.google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
PriceInfo.Builder

clone()

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

getCost()

public float getCost()

The costs associated with the sale of a particular product. Used for gross profit reporting.

float cost = 4;

Returns
Type Description
float

The cost.

getCurrencyCode()

public String getCurrencyCode()

The 3-letter currency code defined in ISO 4217.

If this field is an unrecognizable currency code, an INVALID_ARGUMENT error is returned.

The Product.Type.VARIANT Products with the same Product.primary_product_id must share the same currency_code. Otherwise, a FAILED_PRECONDITION error is returned.

string currency_code = 1;

Returns
Type Description
String

The currencyCode.

getCurrencyCodeBytes()

public ByteString getCurrencyCodeBytes()

The 3-letter currency code defined in ISO 4217.

If this field is an unrecognizable currency code, an INVALID_ARGUMENT error is returned.

The Product.Type.VARIANT Products with the same Product.primary_product_id must share the same currency_code. Otherwise, a FAILED_PRECONDITION error is returned.

string currency_code = 1;

Returns
Type Description
ByteString

The bytes for currencyCode.

getDefaultInstanceForType()

public PriceInfo getDefaultInstanceForType()
Returns
Type Description
PriceInfo

getDescriptorForType()

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

getOriginalPrice()

public float getOriginalPrice()

Price of the product without any discount. If zero, by default set to be the price. If set, original_price should be greater than or equal to price, otherwise an INVALID_ARGUMENT error is thrown.

float original_price = 3;

Returns
Type Description
float

The originalPrice.

getPrice()

public float getPrice()

Price of the product.

Google Merchant Center property price. Schema.org property Offer.price.

float price = 2;

Returns
Type Description
float

The price.

getPriceEffectiveTime()

public Timestamp getPriceEffectiveTime()

The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_effective_time = 5;

Returns
Type Description
Timestamp

The priceEffectiveTime.

getPriceEffectiveTimeBuilder()

public Timestamp.Builder getPriceEffectiveTimeBuilder()

The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_effective_time = 5;

Returns
Type Description
Builder

getPriceEffectiveTimeOrBuilder()

public TimestampOrBuilder getPriceEffectiveTimeOrBuilder()

The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_effective_time = 5;

Returns
Type Description
TimestampOrBuilder

getPriceExpireTime()

public Timestamp getPriceExpireTime()

The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_expire_time = 6;

Returns
Type Description
Timestamp

The priceExpireTime.

getPriceExpireTimeBuilder()

public Timestamp.Builder getPriceExpireTimeBuilder()

The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_expire_time = 6;

Returns
Type Description
Builder

getPriceExpireTimeOrBuilder()

public TimestampOrBuilder getPriceExpireTimeOrBuilder()

The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_expire_time = 6;

Returns
Type Description
TimestampOrBuilder

getPriceRange()

public PriceInfo.PriceRange getPriceRange()

Output only. The price range of all the child Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY Product. Only populated for Product.Type.PRIMARY Products.

Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.

.google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
PriceInfo.PriceRange

The priceRange.

getPriceRangeBuilder()

public PriceInfo.PriceRange.Builder getPriceRangeBuilder()

Output only. The price range of all the child Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY Product. Only populated for Product.Type.PRIMARY Products.

Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.

.google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
PriceInfo.PriceRange.Builder

getPriceRangeOrBuilder()

public PriceInfo.PriceRangeOrBuilder getPriceRangeOrBuilder()

Output only. The price range of all the child Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY Product. Only populated for Product.Type.PRIMARY Products.

Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.

.google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
PriceInfo.PriceRangeOrBuilder

hasPriceEffectiveTime()

public boolean hasPriceEffectiveTime()

The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_effective_time = 5;

Returns
Type Description
boolean

Whether the priceEffectiveTime field is set.

hasPriceExpireTime()

public boolean hasPriceExpireTime()

The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_expire_time = 6;

Returns
Type Description
boolean

Whether the priceExpireTime field is set.

hasPriceRange()

public boolean hasPriceRange()

Output only. The price range of all the child Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY Product. Only populated for Product.Type.PRIMARY Products.

Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.

.google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the priceRange field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(PriceInfo other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergePriceEffectiveTime(Timestamp value)

public PriceInfo.Builder mergePriceEffectiveTime(Timestamp value)

The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_effective_time = 5;

Parameter
Name Description
value Timestamp
Returns
Type Description
PriceInfo.Builder

mergePriceExpireTime(Timestamp value)

public PriceInfo.Builder mergePriceExpireTime(Timestamp value)

The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_expire_time = 6;

Parameter
Name Description
value Timestamp
Returns
Type Description
PriceInfo.Builder

mergePriceRange(PriceInfo.PriceRange value)

public PriceInfo.Builder mergePriceRange(PriceInfo.PriceRange value)

Output only. The price range of all the child Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY Product. Only populated for Product.Type.PRIMARY Products.

Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.

.google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value PriceInfo.PriceRange
Returns
Type Description
PriceInfo.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setCost(float value)

public PriceInfo.Builder setCost(float value)

The costs associated with the sale of a particular product. Used for gross profit reporting.

float cost = 4;

Parameter
Name Description
value float

The cost to set.

Returns
Type Description
PriceInfo.Builder

This builder for chaining.

setCurrencyCode(String value)

public PriceInfo.Builder setCurrencyCode(String value)

The 3-letter currency code defined in ISO 4217.

If this field is an unrecognizable currency code, an INVALID_ARGUMENT error is returned.

The Product.Type.VARIANT Products with the same Product.primary_product_id must share the same currency_code. Otherwise, a FAILED_PRECONDITION error is returned.

string currency_code = 1;

Parameter
Name Description
value String

The currencyCode to set.

Returns
Type Description
PriceInfo.Builder

This builder for chaining.

setCurrencyCodeBytes(ByteString value)

public PriceInfo.Builder setCurrencyCodeBytes(ByteString value)

The 3-letter currency code defined in ISO 4217.

If this field is an unrecognizable currency code, an INVALID_ARGUMENT error is returned.

The Product.Type.VARIANT Products with the same Product.primary_product_id must share the same currency_code. Otherwise, a FAILED_PRECONDITION error is returned.

string currency_code = 1;

Parameter
Name Description
value ByteString

The bytes for currencyCode to set.

Returns
Type Description
PriceInfo.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setOriginalPrice(float value)

public PriceInfo.Builder setOriginalPrice(float value)

Price of the product without any discount. If zero, by default set to be the price. If set, original_price should be greater than or equal to price, otherwise an INVALID_ARGUMENT error is thrown.

float original_price = 3;

Parameter
Name Description
value float

The originalPrice to set.

Returns
Type Description
PriceInfo.Builder

This builder for chaining.

setPrice(float value)

public PriceInfo.Builder setPrice(float value)

Price of the product.

Google Merchant Center property price. Schema.org property Offer.price.

float price = 2;

Parameter
Name Description
value float

The price to set.

Returns
Type Description
PriceInfo.Builder

This builder for chaining.

setPriceEffectiveTime(Timestamp value)

public PriceInfo.Builder setPriceEffectiveTime(Timestamp value)

The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_effective_time = 5;

Parameter
Name Description
value Timestamp
Returns
Type Description
PriceInfo.Builder

setPriceEffectiveTime(Timestamp.Builder builderForValue)

public PriceInfo.Builder setPriceEffectiveTime(Timestamp.Builder builderForValue)

The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_effective_time = 5;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
PriceInfo.Builder

setPriceExpireTime(Timestamp value)

public PriceInfo.Builder setPriceExpireTime(Timestamp value)

The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_expire_time = 6;

Parameter
Name Description
value Timestamp
Returns
Type Description
PriceInfo.Builder

setPriceExpireTime(Timestamp.Builder builderForValue)

public PriceInfo.Builder setPriceExpireTime(Timestamp.Builder builderForValue)

The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time.

Do not set if price is always effective because it will cause additional latency during search.

.google.protobuf.Timestamp price_expire_time = 6;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
PriceInfo.Builder

setPriceRange(PriceInfo.PriceRange value)

public PriceInfo.Builder setPriceRange(PriceInfo.PriceRange value)

Output only. The price range of all the child Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY Product. Only populated for Product.Type.PRIMARY Products.

Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.

.google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value PriceInfo.PriceRange
Returns
Type Description
PriceInfo.Builder

setPriceRange(PriceInfo.PriceRange.Builder builderForValue)

public PriceInfo.Builder setPriceRange(PriceInfo.PriceRange.Builder builderForValue)

Output only. The price range of all the child Product.Type.VARIANT Products grouped together on the Product.Type.PRIMARY Product. Only populated for Product.Type.PRIMARY Products.

Note: This field is OUTPUT_ONLY for ProductService.GetProduct. Do not set this field in API requests.

.google.cloud.retail.v2beta.PriceInfo.PriceRange price_range = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue PriceInfo.PriceRange.Builder
Returns
Type Description
PriceInfo.Builder

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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