Interface DiscountedPrice


public interface DiscountedPrice
DiscountedPrice
Example to create an instance using the builder pattern

     DiscountedPrice discountedPrice = DiscountedPrice.builder()
             .value(valueBuilder -> valueBuilder)
             .discount(discountBuilder -> discountBuilder)
             .build()
 
  • Method Details

    • getValue

      @NotNull @Valid @NotNull @Valid TypedMoney getValue()

      Money value of the discounted price.

      Returns:
      value
    • getDiscount

      @NotNull @Valid @NotNull @Valid ProductDiscountKeyReference getDiscount()

      Reference to a ProductDiscount.

      Returns:
      discount
    • setValue

      void setValue(TypedMoney value)

      Money value of the discounted price.

      Parameters:
      value - value to be set
    • setDiscount

      void setDiscount(ProductDiscountKeyReference discount)

      Reference to a ProductDiscount.

      Parameters:
      discount - value to be set
    • of

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

      static DiscountedPrice of(DiscountedPrice template)
      factory method to create a shallow copy DiscountedPrice
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static DiscountedPrice deepCopy(@Nullable DiscountedPrice template)
      factory method to create a deep copy of DiscountedPrice
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static DiscountedPriceBuilder builder()
      builder factory method for DiscountedPrice
      Returns:
      builder
    • builder

      static DiscountedPriceBuilder builder(DiscountedPrice template)
      create builder for DiscountedPrice instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withDiscountedPrice

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