Class PriceInfo.Builder (2.2.2)

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public PriceInfo build()
Returns
TypeDescription
PriceInfo

buildPartial()

public PriceInfo buildPartial()
Returns
TypeDescription
PriceInfo

clear()

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

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public PriceInfo.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
PriceInfo.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public PriceInfo.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
PriceInfo.Builder
Overrides

clearOriginalPrice()

public PriceInfo.Builder clearOriginalPrice()

Price of the product without any discount. If zero, by default set to be the price.

float original_price = 3;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
PriceInfo.Builder

clone()

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

The bytes for currencyCode.

getDefaultInstanceForType()

public PriceInfo getDefaultInstanceForType()
Returns
TypeDescription
PriceInfo

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getOriginalPrice()

public float getOriginalPrice()

Price of the product without any discount. If zero, by default set to be the price.

float original_price = 3;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the priceRange field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(PriceInfo other)

public PriceInfo.Builder mergeFrom(PriceInfo other)
Parameter
NameDescription
otherPriceInfo
Returns
TypeDescription
PriceInfo.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public PriceInfo.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueTimestamp
Returns
TypeDescription
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
NameDescription
valueTimestamp
Returns
TypeDescription
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
NameDescription
valuePriceInfo.PriceRange
Returns
TypeDescription
PriceInfo.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

The cost to set.

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

The currencyCode to set.

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

The bytes for currencyCode to set.

Returns
TypeDescription
PriceInfo.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

float original_price = 3;

Parameter
NameDescription
valuefloat

The originalPrice to set.

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

The price to set.

Returns
TypeDescription
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
NameDescription
valueTimestamp
Returns
TypeDescription
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
NameDescription
builderForValueBuilder
Returns
TypeDescription
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
NameDescription
valueTimestamp
Returns
TypeDescription
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
NameDescription
builderForValueBuilder
Returns
TypeDescription
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
NameDescription
valuePriceInfo.PriceRange
Returns
TypeDescription
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
NameDescription
builderForValuePriceInfo.PriceRange.Builder
Returns
TypeDescription
PriceInfo.Builder

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

public PriceInfo.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
PriceInfo.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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