Class LineItemDiscount (0.54.0)

public final class LineItemDiscount extends GeneratedMessage implements LineItemDiscountOrBuilder

Discount information for a LineItem.

Protobuf type google.ads.admanager.v1.LineItemDiscount

Static Fields

DISCOUNT_FIELD_NUMBER

public static final int DISCOUNT_FIELD_NUMBER
Field Value
Type Description
int

DISCOUNT_TYPE_FIELD_NUMBER

public static final int DISCOUNT_TYPE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static LineItemDiscount getDefaultInstance()
Returns
Type Description
LineItemDiscount

getDescriptor()

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

newBuilder()

public static LineItemDiscount.Builder newBuilder()
Returns
Type Description
LineItemDiscount.Builder

newBuilder(LineItemDiscount prototype)

public static LineItemDiscount.Builder newBuilder(LineItemDiscount prototype)
Parameter
Name Description
prototype LineItemDiscount
Returns
Type Description
LineItemDiscount.Builder

parseDelimitedFrom(InputStream input)

public static LineItemDiscount parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static LineItemDiscount parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static LineItemDiscount parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static LineItemDiscount parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static LineItemDiscount parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static LineItemDiscount parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static LineItemDiscount parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static LineItemDiscount parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static LineItemDiscount parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static LineItemDiscount parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static LineItemDiscount parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static LineItemDiscount parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
LineItemDiscount
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<LineItemDiscount> parser()
Returns
Type Description
Parser<LineItemDiscount>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public LineItemDiscount getDefaultInstanceForType()
Returns
Type Description
LineItemDiscount

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.

getParserForType()

public Parser<LineItemDiscount> getParserForType()
Returns
Type Description
Parser<LineItemDiscount>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public LineItemDiscount.Builder newBuilderForType()
Returns
Type Description
LineItemDiscount.Builder

newBuilderForType(AbstractMessage.BuilderParent parent)

protected LineItemDiscount.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
LineItemDiscount.Builder
Overrides

toBuilder()

public LineItemDiscount.Builder toBuilder()
Returns
Type Description
LineItemDiscount.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException