Interface ProductDiscountDraft

All Superinterfaces:
Draft<ProductDiscountDraft>, WithKey

public interface ProductDiscountDraft extends WithKey, Draft<ProductDiscountDraft>
ProductDiscountDraft
Example to create an instance using the builder pattern

     ProductDiscountDraft productDiscountDraft = ProductDiscountDraft.builder()
             .name(nameBuilder -> nameBuilder)
             .value(valueBuilder -> valueBuilder)
             .predicate("{predicate}")
             .sortOrder("{sortOrder}")
             .isActive(true)
             .build()
 
  • Method Details

    • getName

      @NotNull @Valid @NotNull @Valid LocalizedString getName()

      Name of the ProductDiscount.

      Returns:
      name
    • getKey

      String getKey()

      User-defined unique identifier for the ProductDiscount.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getDescription

      @Valid @Valid LocalizedString getDescription()

      Description of the ProductDiscount.

      Returns:
      description
    • getValue

      @NotNull @Valid @NotNull @Valid ProductDiscountValueDraft getValue()

      Type of Discount and its corresponding value.

      Returns:
      value
    • getPredicate

      @NotNull @NotNull String getPredicate()

      Valid ProductDiscount predicate.

      Returns:
      predicate
    • getSortOrder

      @NotNull @NotNull String getSortOrder()

      Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher sortOrder is prioritized. The value must be unique among all ProductDiscounts in the Project.

      Returns:
      sortOrder
    • getIsActive

      @NotNull @NotNull Boolean getIsActive()

      Set to true to activate the ProductDiscount, set to false to deactivate it (even though the predicate matches).

      Returns:
      isActive
    • getValidFrom

      ZonedDateTime getValidFrom()

      Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.

      Returns:
      validFrom
    • getValidUntil

      ZonedDateTime getValidUntil()

      Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.

      Returns:
      validUntil
    • setName

      void setName(LocalizedString name)

      Name of the ProductDiscount.

      Parameters:
      name - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier for the ProductDiscount.

      Parameters:
      key - value to be set
    • setDescription

      void setDescription(LocalizedString description)

      Description of the ProductDiscount.

      Parameters:
      description - value to be set
    • setValue

      void setValue(ProductDiscountValueDraft value)

      Type of Discount and its corresponding value.

      Parameters:
      value - value to be set
    • setPredicate

      void setPredicate(String predicate)

      Valid ProductDiscount predicate.

      Parameters:
      predicate - value to be set
    • setSortOrder

      void setSortOrder(String sortOrder)

      Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher sortOrder is prioritized. The value must be unique among all ProductDiscounts in the Project.

      Parameters:
      sortOrder - value to be set
    • setIsActive

      void setIsActive(Boolean isActive)

      Set to true to activate the ProductDiscount, set to false to deactivate it (even though the predicate matches).

      Parameters:
      isActive - value to be set
    • setValidFrom

      void setValidFrom(ZonedDateTime validFrom)

      Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.

      Parameters:
      validFrom - value to be set
    • setValidUntil

      void setValidUntil(ZonedDateTime validUntil)

      Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.

      Parameters:
      validUntil - value to be set
    • of

      static ProductDiscountDraft of()
      factory method
      Returns:
      instance of ProductDiscountDraft
    • of

      factory method to create a shallow copy ProductDiscountDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of ProductDiscountDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ProductDiscountDraftBuilder builder()
      builder factory method for ProductDiscountDraft
      Returns:
      builder
    • builder

      create builder for ProductDiscountDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductDiscountDraft

      default <T> T withProductDiscountDraft(Function<ProductDiscountDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ProductDiscountDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference