Class DiscountComponent.Builder (3.85.0)
Version latestkeyboard_arrow_down
public static final class DiscountComponent . Builder extends GeneratedMessageV3 . Builder<DiscountComponent . Builder > implements DiscountComponentOrBuilder
Represents a single component of the total discount applicable on a Price.
Protobuf type google.cloud.channel.v1.DiscountComponent
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public DiscountComponent . Builder addRepeatedField ( Descriptors . FieldDescriptor field , Object value )
Overrides
build()
public DiscountComponent build ()
buildPartial()
public DiscountComponent buildPartial ()
clear()
public DiscountComponent . Builder clear ()
Overrides
clearDiscountAbsolute()
public DiscountComponent . Builder clearDiscountAbsolute ()
Fixed value discount.
.google.type.Money discount_absolute = 4;
clearDiscountPercentage()
public DiscountComponent . Builder clearDiscountPercentage ()
Discount percentage, represented as decimal.
For example, a 20% discount will be represented as 0.2.
double discount_percentage = 3;
clearDiscountType()
public DiscountComponent . Builder clearDiscountType ()
Type of the discount.
.google.cloud.channel.v1.DiscountType discount_type = 2;
clearDiscountValue()
public DiscountComponent . Builder clearDiscountValue ()
clearField(Descriptors.FieldDescriptor field)
public DiscountComponent . Builder clearField ( Descriptors . FieldDescriptor field )
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public DiscountComponent . Builder clearOneof ( Descriptors . OneofDescriptor oneof )
Overrides
clone()
public DiscountComponent . Builder clone ()
Overrides
getDefaultInstanceForType()
public DiscountComponent getDefaultInstanceForType ()
getDescriptorForType()
public Descriptors . Descriptor getDescriptorForType ()
Overrides
getDiscountAbsolute()
public Money getDiscountAbsolute ()
Fixed value discount.
.google.type.Money discount_absolute = 4;
Returns
Type
Description
com.google.type.Money
The discountAbsolute.
getDiscountAbsoluteBuilder()
public Money . Builder getDiscountAbsoluteBuilder ()
Fixed value discount.
.google.type.Money discount_absolute = 4;
Returns
Type
Description
com.google.type.Money.Builder
getDiscountAbsoluteOrBuilder()
public MoneyOrBuilder getDiscountAbsoluteOrBuilder ()
Fixed value discount.
.google.type.Money discount_absolute = 4;
Returns
Type
Description
com.google.type.MoneyOrBuilder
getDiscountPercentage()
public double getDiscountPercentage ()
Discount percentage, represented as decimal.
For example, a 20% discount will be represented as 0.2.
double discount_percentage = 3;
Returns
Type
Description
double
The discountPercentage.
getDiscountType()
public DiscountType getDiscountType ()
Type of the discount.
.google.cloud.channel.v1.DiscountType discount_type = 2;
getDiscountTypeValue()
public int getDiscountTypeValue ()
Type of the discount.
.google.cloud.channel.v1.DiscountType discount_type = 2;
Returns
Type
Description
int
The enum numeric value on the wire for discountType.
getDiscountValueCase()
public DiscountComponent . DiscountValueCase getDiscountValueCase ()
hasDiscountAbsolute()
public boolean hasDiscountAbsolute ()
Fixed value discount.
.google.type.Money discount_absolute = 4;
Returns
Type
Description
boolean
Whether the discountAbsolute field is set.
hasDiscountPercentage()
public boolean hasDiscountPercentage ()
Discount percentage, represented as decimal.
For example, a 20% discount will be represented as 0.2.
double discount_percentage = 3;
Returns
Type
Description
boolean
Whether the discountPercentage field is set.
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Overrides
isInitialized()
public final boolean isInitialized ()
Overrides
mergeDiscountAbsolute(Money value)
public DiscountComponent . Builder mergeDiscountAbsolute ( Money value )
Fixed value discount.
.google.type.Money discount_absolute = 4;
Parameter
Name
Description
value
com.google.type.Money
mergeFrom(DiscountComponent other)
public DiscountComponent . Builder mergeFrom ( DiscountComponent other )
public DiscountComponent . Builder mergeFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
Overrides
mergeFrom(Message other)
public DiscountComponent . Builder mergeFrom ( Message other )
Parameter
Name
Description
other
Message
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final DiscountComponent . Builder mergeUnknownFields ( UnknownFieldSet unknownFields )
Overrides
setDiscountAbsolute(Money value)
public DiscountComponent . Builder setDiscountAbsolute ( Money value )
Fixed value discount.
.google.type.Money discount_absolute = 4;
Parameter
Name
Description
value
com.google.type.Money
setDiscountAbsolute(Money.Builder builderForValue)
public DiscountComponent . Builder setDiscountAbsolute ( Money . Builder builderForValue )
Fixed value discount.
.google.type.Money discount_absolute = 4;
Parameter
Name
Description
builderForValue
com.google.type.Money.Builder
setDiscountPercentage(double value)
public DiscountComponent . Builder setDiscountPercentage ( double value )
Discount percentage, represented as decimal.
For example, a 20% discount will be represented as 0.2.
double discount_percentage = 3;
Parameter
Name
Description
value
double The discountPercentage to set.
setDiscountType(DiscountType value)
public DiscountComponent . Builder setDiscountType ( DiscountType value )
Type of the discount.
.google.cloud.channel.v1.DiscountType discount_type = 2;
Parameter
Name
Description
value
DiscountType The discountType to set.
setDiscountTypeValue(int value)
public DiscountComponent . Builder setDiscountTypeValue ( int value )
Type of the discount.
.google.cloud.channel.v1.DiscountType discount_type = 2;
Parameter
Name
Description
value
int The enum numeric value on the wire for discountType to set.
setField(Descriptors.FieldDescriptor field, Object value)
public DiscountComponent . Builder setField ( Descriptors . FieldDescriptor field , Object value )
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public DiscountComponent . Builder setRepeatedField ( Descriptors . FieldDescriptor field , int index , Object value )
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final DiscountComponent . Builder setUnknownFields ( UnknownFieldSet unknownFields )
Overrides
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-01-10 UTC."],[],[]]