Class DiscountComponent.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<DiscountComponent.Builder>
com.google.cloud.channel.v1.DiscountComponent.Builder
All Implemented Interfaces:
DiscountComponentOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
DiscountComponent

public static final class DiscountComponent.Builder extends com.google.protobuf.GeneratedMessage.Builder<DiscountComponent.Builder> implements DiscountComponentOrBuilder
 Represents a single component of the total discount applicable on a Price.
 
Protobuf type google.cloud.channel.v1.DiscountComponent
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<DiscountComponent.Builder>
    • clear

      public DiscountComponent.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<DiscountComponent.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<DiscountComponent.Builder>
    • getDefaultInstanceForType

      public DiscountComponent getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public DiscountComponent build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public DiscountComponent buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public DiscountComponent.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<DiscountComponent.Builder>
    • mergeFrom

      public DiscountComponent.Builder mergeFrom(DiscountComponent other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<DiscountComponent.Builder>
    • mergeFrom

      public DiscountComponent.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<DiscountComponent.Builder>
      Throws:
      IOException
    • getDiscountValueCase

      public DiscountComponent.DiscountValueCase getDiscountValueCase()
      Specified by:
      getDiscountValueCase in interface DiscountComponentOrBuilder
    • clearDiscountValue

      public DiscountComponent.Builder clearDiscountValue()
    • hasDiscountPercentage

      public boolean hasDiscountPercentage()
       Discount percentage, represented as decimal.
       For example, a 20% discount will be represented as 0.2.
       
      double discount_percentage = 3;
      Specified by:
      hasDiscountPercentage in interface DiscountComponentOrBuilder
      Returns:
      Whether the discountPercentage field is set.
    • getDiscountPercentage

      public double getDiscountPercentage()
       Discount percentage, represented as decimal.
       For example, a 20% discount will be represented as 0.2.
       
      double discount_percentage = 3;
      Specified by:
      getDiscountPercentage in interface DiscountComponentOrBuilder
      Returns:
      The discountPercentage.
    • setDiscountPercentage

      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;
      Parameters:
      value - The discountPercentage to set.
      Returns:
      This builder for chaining.
    • 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;
      Returns:
      This builder for chaining.
    • hasDiscountAbsolute

      public boolean hasDiscountAbsolute()
       Fixed value discount.
       
      .google.type.Money discount_absolute = 4;
      Specified by:
      hasDiscountAbsolute in interface DiscountComponentOrBuilder
      Returns:
      Whether the discountAbsolute field is set.
    • getDiscountAbsolute

      public Money getDiscountAbsolute()
       Fixed value discount.
       
      .google.type.Money discount_absolute = 4;
      Specified by:
      getDiscountAbsolute in interface DiscountComponentOrBuilder
      Returns:
      The discountAbsolute.
    • setDiscountAbsolute

      public DiscountComponent.Builder setDiscountAbsolute(Money value)
       Fixed value discount.
       
      .google.type.Money discount_absolute = 4;
    • setDiscountAbsolute

      public DiscountComponent.Builder setDiscountAbsolute(Money.Builder builderForValue)
       Fixed value discount.
       
      .google.type.Money discount_absolute = 4;
    • mergeDiscountAbsolute

      public DiscountComponent.Builder mergeDiscountAbsolute(Money value)
       Fixed value discount.
       
      .google.type.Money discount_absolute = 4;
    • clearDiscountAbsolute

      public DiscountComponent.Builder clearDiscountAbsolute()
       Fixed value discount.
       
      .google.type.Money discount_absolute = 4;
    • getDiscountAbsoluteBuilder

      public Money.Builder getDiscountAbsoluteBuilder()
       Fixed value discount.
       
      .google.type.Money discount_absolute = 4;
    • getDiscountAbsoluteOrBuilder

      public MoneyOrBuilder getDiscountAbsoluteOrBuilder()
       Fixed value discount.
       
      .google.type.Money discount_absolute = 4;
      Specified by:
      getDiscountAbsoluteOrBuilder in interface DiscountComponentOrBuilder
    • getDiscountTypeValue

      public int getDiscountTypeValue()
       Type of the discount.
       
      .google.cloud.channel.v1.DiscountType discount_type = 2;
      Specified by:
      getDiscountTypeValue in interface DiscountComponentOrBuilder
      Returns:
      The enum numeric value on the wire for discountType.
    • setDiscountTypeValue

      public DiscountComponent.Builder setDiscountTypeValue(int value)
       Type of the discount.
       
      .google.cloud.channel.v1.DiscountType discount_type = 2;
      Parameters:
      value - The enum numeric value on the wire for discountType to set.
      Returns:
      This builder for chaining.
    • getDiscountType

      public DiscountType getDiscountType()
       Type of the discount.
       
      .google.cloud.channel.v1.DiscountType discount_type = 2;
      Specified by:
      getDiscountType in interface DiscountComponentOrBuilder
      Returns:
      The discountType.
    • setDiscountType

      public DiscountComponent.Builder setDiscountType(DiscountType value)
       Type of the discount.
       
      .google.cloud.channel.v1.DiscountType discount_type = 2;
      Parameters:
      value - The discountType to set.
      Returns:
      This builder for chaining.
    • clearDiscountType

      public DiscountComponent.Builder clearDiscountType()
       Type of the discount.
       
      .google.cloud.channel.v1.DiscountType discount_type = 2;
      Returns:
      This builder for chaining.