Class DiscountedLineItemPortionBuilder

java.lang.Object
com.commercetools.api.models.cart.DiscountedLineItemPortionBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<DiscountedLineItemPortion>

public class DiscountedLineItemPortionBuilder extends Object implements io.vrap.rmf.base.client.Builder<DiscountedLineItemPortion>
DiscountedLineItemPortionBuilder
Example to create an instance using the builder pattern

     DiscountedLineItemPortion discountedLineItemPortion = DiscountedLineItemPortion.builder()
             .discount(discountBuilder -> discountBuilder)
             .discountedAmount(discountedAmountBuilder -> discountedAmountBuilder)
             .build()
 
  • Constructor Details

    • DiscountedLineItemPortionBuilder

      public DiscountedLineItemPortionBuilder()
  • Method Details

    • discount

      public DiscountedLineItemPortionBuilder discount(Reference discount)

      A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.

      Parameters:
      discount - value to be set
      Returns:
      Builder
    • discount

      public DiscountedLineItemPortionBuilder discount(Function<ReferenceBuilder,io.vrap.rmf.base.client.Builder<? extends Reference>> builder)

      A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.

      Parameters:
      builder - function to build the discount value
      Returns:
      Builder
    • discountedAmount

      public DiscountedLineItemPortionBuilder discountedAmount(TypedMoney discountedAmount)

      Money value of the discount applicable.

      Parameters:
      discountedAmount - value to be set
      Returns:
      Builder
    • discountedAmount

      public DiscountedLineItemPortionBuilder discountedAmount(Function<TypedMoneyBuilder,io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder)

      Money value of the discount applicable.

      Parameters:
      builder - function to build the discountedAmount value
      Returns:
      Builder
    • getDiscount

      public Reference getDiscount()

      A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.

      Returns:
      discount
    • getDiscountedAmount

      public TypedMoney getDiscountedAmount()

      Money value of the discount applicable.

      Returns:
      discountedAmount
    • build

      public DiscountedLineItemPortion build()
      builds DiscountedLineItemPortion with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<DiscountedLineItemPortion>
      Returns:
      DiscountedLineItemPortion
    • buildUnchecked

      public DiscountedLineItemPortion buildUnchecked()
      builds DiscountedLineItemPortion without checking for non-null required values
      Returns:
      DiscountedLineItemPortion
    • of

      factory method for an instance of DiscountedLineItemPortionBuilder
      Returns:
      builder
    • of

      create builder for DiscountedLineItemPortion instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder