Class PriceTier.Builder (3.11.0)

public static final class PriceTier.Builder extends GeneratedMessageV3.Builder<PriceTier.Builder> implements PriceTierOrBuilder

Defines price at resource tier level. For example, an offer with following definition :

  • Tier 1: Provide 25% discount for all seats between 1 and 25.
  • Tier 2: Provide 10% discount for all seats between 26 and 100.
  • Tier 3: Provide flat 15% discount for all seats above 100. Each of these tiers is represented as a PriceTier.

Protobuf type google.cloud.channel.v1.PriceTier

Implements

PriceTierOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public PriceTier build()
Returns
TypeDescription
PriceTier

buildPartial()

public PriceTier buildPartial()
Returns
TypeDescription
PriceTier

clear()

public PriceTier.Builder clear()
Returns
TypeDescription
PriceTier.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

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

clearFirstResource()

public PriceTier.Builder clearFirstResource()

First resource for which the tier price applies.

int32 first_resource = 1;

Returns
TypeDescription
PriceTier.Builder

This builder for chaining.

clearLastResource()

public PriceTier.Builder clearLastResource()

Last resource for which the tier price applies.

int32 last_resource = 2;

Returns
TypeDescription
PriceTier.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPrice()

public PriceTier.Builder clearPrice()

Price of the tier.

.google.cloud.channel.v1.Price price = 3;

Returns
TypeDescription
PriceTier.Builder

clone()

public PriceTier.Builder clone()
Returns
TypeDescription
PriceTier.Builder
Overrides

getDefaultInstanceForType()

public PriceTier getDefaultInstanceForType()
Returns
TypeDescription
PriceTier

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getFirstResource()

public int getFirstResource()

First resource for which the tier price applies.

int32 first_resource = 1;

Returns
TypeDescription
int

The firstResource.

getLastResource()

public int getLastResource()

Last resource for which the tier price applies.

int32 last_resource = 2;

Returns
TypeDescription
int

The lastResource.

getPrice()

public Price getPrice()

Price of the tier.

.google.cloud.channel.v1.Price price = 3;

Returns
TypeDescription
Price

The price.

getPriceBuilder()

public Price.Builder getPriceBuilder()

Price of the tier.

.google.cloud.channel.v1.Price price = 3;

Returns
TypeDescription
Price.Builder

getPriceOrBuilder()

public PriceOrBuilder getPriceOrBuilder()

Price of the tier.

.google.cloud.channel.v1.Price price = 3;

Returns
TypeDescription
PriceOrBuilder

hasPrice()

public boolean hasPrice()

Price of the tier.

.google.cloud.channel.v1.Price price = 3;

Returns
TypeDescription
boolean

Whether the price field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(PriceTier other)

public PriceTier.Builder mergeFrom(PriceTier other)
Parameter
NameDescription
otherPriceTier
Returns
TypeDescription
PriceTier.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public PriceTier.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
PriceTier.Builder
Overrides

mergePrice(Price value)

public PriceTier.Builder mergePrice(Price value)

Price of the tier.

.google.cloud.channel.v1.Price price = 3;

Parameter
NameDescription
valuePrice
Returns
TypeDescription
PriceTier.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PriceTier.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PriceTier.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

setFirstResource(int value)

public PriceTier.Builder setFirstResource(int value)

First resource for which the tier price applies.

int32 first_resource = 1;

Parameter
NameDescription
valueint

The firstResource to set.

Returns
TypeDescription
PriceTier.Builder

This builder for chaining.

setLastResource(int value)

public PriceTier.Builder setLastResource(int value)

Last resource for which the tier price applies.

int32 last_resource = 2;

Parameter
NameDescription
valueint

The lastResource to set.

Returns
TypeDescription
PriceTier.Builder

This builder for chaining.

setPrice(Price value)

public PriceTier.Builder setPrice(Price value)

Price of the tier.

.google.cloud.channel.v1.Price price = 3;

Parameter
NameDescription
valuePrice
Returns
TypeDescription
PriceTier.Builder

setPrice(Price.Builder builderForValue)

public PriceTier.Builder setPrice(Price.Builder builderForValue)

Price of the tier.

.google.cloud.channel.v1.Price price = 3;

Parameter
NameDescription
builderForValuePrice.Builder
Returns
TypeDescription
PriceTier.Builder

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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