public static final class LineItemDiscount.Builder extends GeneratedMessage.Builder<LineItemDiscount.Builder> implements LineItemDiscountOrBuilderDiscount information for a LineItem.
Protobuf type google.ads.admanager.v1.LineItemDiscount
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessage.Builder > LineItemDiscount.BuilderImplements
LineItemDiscountOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
Methods
build()
public LineItemDiscount build()| Returns | |
|---|---|
| Type | Description |
LineItemDiscount |
|
buildPartial()
public LineItemDiscount buildPartial()| Returns | |
|---|---|
| Type | Description |
LineItemDiscount |
|
clear()
public LineItemDiscount.Builder clear()| Returns | |
|---|---|
| Type | Description |
LineItemDiscount.Builder |
|
clearDiscount()
public LineItemDiscount.Builder clearDiscount()Optional. The number here is either a percentage or an absolute value depending on the DiscountType. If the DiscountType is PERCENTAGE, then only non-fractional values are supported.
optional double discount = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
LineItemDiscount.Builder |
This builder for chaining. |
clearDiscountType()
public LineItemDiscount.Builder clearDiscountType()Optional. The type of discount being applied to a LineItem, either percentage based or absolute. This attribute is optional and defaults to PERCENTAGE.
optional .google.ads.admanager.v1.DiscountTypeEnum.DiscountType discount_type = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
LineItemDiscount.Builder |
This builder for chaining. |
getDefaultInstanceForType()
public LineItemDiscount getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
LineItemDiscount |
|
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
getDiscount()
public double getDiscount()Optional. The number here is either a percentage or an absolute value depending on the DiscountType. If the DiscountType is PERCENTAGE, then only non-fractional values are supported.
optional double discount = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
double |
The discount. |
getDiscountType()
public DiscountTypeEnum.DiscountType getDiscountType()Optional. The type of discount being applied to a LineItem, either percentage based or absolute. This attribute is optional and defaults to PERCENTAGE.
optional .google.ads.admanager.v1.DiscountTypeEnum.DiscountType discount_type = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
DiscountTypeEnum.DiscountType |
The discountType. |
getDiscountTypeValue()
public int getDiscountTypeValue()Optional. The type of discount being applied to a LineItem, either percentage based or absolute. This attribute is optional and defaults to PERCENTAGE.
optional .google.ads.admanager.v1.DiscountTypeEnum.DiscountType discount_type = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
int |
The enum numeric value on the wire for discountType. |
hasDiscount()
public boolean hasDiscount()Optional. The number here is either a percentage or an absolute value depending on the DiscountType. If the DiscountType is PERCENTAGE, then only non-fractional values are supported.
optional double discount = 2 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the discount field is set. |
hasDiscountType()
public boolean hasDiscountType()Optional. The type of discount being applied to a LineItem, either percentage based or absolute. This attribute is optional and defaults to PERCENTAGE.
optional .google.ads.admanager.v1.DiscountTypeEnum.DiscountType discount_type = 1 [(.google.api.field_behavior) = OPTIONAL];
| Returns | |
|---|---|
| Type | Description |
boolean |
Whether the discountType field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
isInitialized()
public final boolean isInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
mergeFrom(LineItemDiscount other)
public LineItemDiscount.Builder mergeFrom(LineItemDiscount other)| Parameter | |
|---|---|
| Name | Description |
other |
LineItemDiscount |
| Returns | |
|---|---|
| Type | Description |
LineItemDiscount.Builder |
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public LineItemDiscount.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
LineItemDiscount.Builder |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
mergeFrom(Message other)
public LineItemDiscount.Builder mergeFrom(Message other)| Parameter | |
|---|---|
| Name | Description |
other |
Message |
| Returns | |
|---|---|
| Type | Description |
LineItemDiscount.Builder |
|
setDiscount(double value)
public LineItemDiscount.Builder setDiscount(double value)Optional. The number here is either a percentage or an absolute value depending on the DiscountType. If the DiscountType is PERCENTAGE, then only non-fractional values are supported.
optional double discount = 2 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
doubleThe discount to set. |
| Returns | |
|---|---|
| Type | Description |
LineItemDiscount.Builder |
This builder for chaining. |
setDiscountType(DiscountTypeEnum.DiscountType value)
public LineItemDiscount.Builder setDiscountType(DiscountTypeEnum.DiscountType value)Optional. The type of discount being applied to a LineItem, either percentage based or absolute. This attribute is optional and defaults to PERCENTAGE.
optional .google.ads.admanager.v1.DiscountTypeEnum.DiscountType discount_type = 1 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
DiscountTypeEnum.DiscountTypeThe discountType to set. |
| Returns | |
|---|---|
| Type | Description |
LineItemDiscount.Builder |
This builder for chaining. |
setDiscountTypeValue(int value)
public LineItemDiscount.Builder setDiscountTypeValue(int value)Optional. The type of discount being applied to a LineItem, either percentage based or absolute. This attribute is optional and defaults to PERCENTAGE.
optional .google.ads.admanager.v1.DiscountTypeEnum.DiscountType discount_type = 1 [(.google.api.field_behavior) = OPTIONAL];
| Parameter | |
|---|---|
| Name | Description |
value |
intThe enum numeric value on the wire for discountType to set. |
| Returns | |
|---|---|
| Type | Description |
LineItemDiscount.Builder |
This builder for chaining. |