Class DiscountGroupDraftBuilder

java.lang.Object
com.commercetools.api.models.discount_group.DiscountGroupDraftBuilder
All Implemented Interfaces:
Builder<DiscountGroupDraft>

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

     DiscountGroupDraft discountGroupDraft = DiscountGroupDraft.builder()
             .key("{key}")
             .sortOrder("{sortOrder}")
             .build()
 
  • Constructor Details

    • DiscountGroupDraftBuilder

      public DiscountGroupDraftBuilder()
  • Method Details

    • name

      Name of the DiscountGroup.

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

      Name of the DiscountGroup.

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

      public DiscountGroupDraftBuilder name(@Nullable LocalizedString name)

      Name of the DiscountGroup.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • key

      User-defined unique identifier for the DiscountGroup.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • description

      Description for the DiscountGroup.

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

      Description for the DiscountGroup.

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

      public DiscountGroupDraftBuilder description(@Nullable LocalizedString description)

      Description for the DiscountGroup.

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

      public DiscountGroupDraftBuilder sortOrder(String sortOrder)

      Value between 0 and 1 that determines the order in which the CartDiscount from the DiscountGroup will be applied; a CartDiscount with a higher value will be prioritized.

      The sort order must be unique among all DiscountGroups and CartDiscounts.

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

      @Nullable public LocalizedString getName()

      Name of the DiscountGroup.

      Returns:
      name
    • getKey

      public String getKey()

      User-defined unique identifier for the DiscountGroup.

      Returns:
      key
    • getDescription

      @Nullable public LocalizedString getDescription()

      Description for the DiscountGroup.

      Returns:
      description
    • getSortOrder

      public String getSortOrder()

      Value between 0 and 1 that determines the order in which the CartDiscount from the DiscountGroup will be applied; a CartDiscount with a higher value will be prioritized.

      The sort order must be unique among all DiscountGroups and CartDiscounts.

      Returns:
      sortOrder
    • build

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

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

      public static DiscountGroupDraftBuilder of()
      factory method for an instance of DiscountGroupDraftBuilder
      Returns:
      builder
    • of

      public static DiscountGroupDraftBuilder of(DiscountGroupDraft template)
      create builder for DiscountGroupDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder