Interface DiscountedPriceDraft

All Superinterfaces:
Draft<DiscountedPriceDraft>

public interface DiscountedPriceDraft extends Draft<DiscountedPriceDraft>
DiscountedPriceDraft
Example to create an instance using the builder pattern

     DiscountedPriceDraft discountedPriceDraft = DiscountedPriceDraft.builder()
             .value(valueBuilder -> valueBuilder)
             .discount(discountBuilder -> discountBuilder)
             .build()
 
  • Method Details

    • getValue

      @NotNull @Valid @NotNull @Valid Money getValue()

      Sets the money value for the discounted price.

      Returns:
      value
    • getDiscount

      @NotNull @Valid @NotNull @Valid ProductDiscountReference getDiscount()

      Relates the referenced ProductDiscount to the discounted price.

      Returns:
      discount
    • setValue

      void setValue(Money value)

      Sets the money value for the discounted price.

      Parameters:
      value - value to be set
    • setDiscount

      void setDiscount(ProductDiscountReference discount)

      Relates the referenced ProductDiscount to the discounted price.

      Parameters:
      discount - value to be set
    • of

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

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

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

      static DiscountedPriceDraftBuilder builder()
      builder factory method for DiscountedPriceDraft
      Returns:
      builder
    • builder

      create builder for DiscountedPriceDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withDiscountedPriceDraft

      default <T> T withDiscountedPriceDraft(Function<DiscountedPriceDraft,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<DiscountedPriceDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference