Class CartDiscountSetDiscountGroupActionBuilder

java.lang.Object
com.commercetools.api.models.cart_discount.CartDiscountSetDiscountGroupActionBuilder
All Implemented Interfaces:
Builder<CartDiscountSetDiscountGroupAction>

public class CartDiscountSetDiscountGroupActionBuilder extends Object implements Builder<CartDiscountSetDiscountGroupAction>
CartDiscountSetDiscountGroupActionBuilder
Example to create an instance using the builder pattern

     CartDiscountSetDiscountGroupAction cartDiscountSetDiscountGroupAction = CartDiscountSetDiscountGroupAction.builder()
             .build()
 
  • Constructor Details

    • CartDiscountSetDiscountGroupActionBuilder

      public CartDiscountSetDiscountGroupActionBuilder()
  • Method Details

    • discountGroup

      Reference to a DiscountGroup that the CartDiscount must belong to. If empty, any existing value will be removed.

      A CartDiscount can only be added to a DiscountGroup if its target.type is lineItems, customLineItems, multiBuyLineItems, multiBuyCustomLineItems, or pattern; otherwise, an InvalidInput error is returned.

      Parameters:
      builder - function to build the discountGroup value
      Returns:
      Builder
    • withDiscountGroup

      Reference to a DiscountGroup that the CartDiscount must belong to. If empty, any existing value will be removed.

      A CartDiscount can only be added to a DiscountGroup if its target.type is lineItems, customLineItems, multiBuyLineItems, multiBuyCustomLineItems, or pattern; otherwise, an InvalidInput error is returned.

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

      public CartDiscountSetDiscountGroupActionBuilder discountGroup(@Nullable DiscountGroupResourceIdentifier discountGroup)

      Reference to a DiscountGroup that the CartDiscount must belong to. If empty, any existing value will be removed.

      A CartDiscount can only be added to a DiscountGroup if its target.type is lineItems, customLineItems, multiBuyLineItems, multiBuyCustomLineItems, or pattern; otherwise, an InvalidInput error is returned.

      Parameters:
      discountGroup - value to be set
      Returns:
      Builder
    • sortOrder

      public CartDiscountSetDiscountGroupActionBuilder sortOrder(@Nullable String sortOrder)

      New value to set (between 0 and 1) that determines the order in which the CartDiscounts are applied; a CartDiscount with a higher value is prioritized.

      Required if discountGroup is absent. If discountGroup is set, the CartDiscount will use the sort order of the DiscountGroup.

      Parameters:
      sortOrder - value to be set
      Returns:
      Builder
    • getDiscountGroup

      @Nullable public DiscountGroupResourceIdentifier getDiscountGroup()

      Reference to a DiscountGroup that the CartDiscount must belong to. If empty, any existing value will be removed.

      A CartDiscount can only be added to a DiscountGroup if its target.type is lineItems, customLineItems, multiBuyLineItems, multiBuyCustomLineItems, or pattern; otherwise, an InvalidInput error is returned.

      Returns:
      discountGroup
    • getSortOrder

      @Nullable public String getSortOrder()

      New value to set (between 0 and 1) that determines the order in which the CartDiscounts are applied; a CartDiscount with a higher value is prioritized.

      Required if discountGroup is absent. If discountGroup is set, the CartDiscount will use the sort order of the DiscountGroup.

      Returns:
      sortOrder
    • build

      builds CartDiscountSetDiscountGroupAction with checking for non-null required values
      Specified by:
      build in interface Builder<CartDiscountSetDiscountGroupAction>
      Returns:
      CartDiscountSetDiscountGroupAction
    • buildUnchecked

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

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

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