Interface PriceTier


public interface PriceTier

A price tier is selected instead of the default price when a certain quantity of the ProductVariant is added to a cart and ordered.


Example to create an instance using the builder pattern

     PriceTier priceTier = PriceTier.builder()
             .minimumQuantity(0.3)
             .value(valueBuilder -> valueBuilder)
             .build()
 
  • Method Details

    • getMinimumQuantity

      @NotNull @NotNull Long getMinimumQuantity()

      The minimum quantity this price tier is valid for.

      Returns:
      minimumQuantity
    • getValue

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

      The currency of a price tier is always the same as the currency of the base Price.

      Returns:
      value
    • setMinimumQuantity

      void setMinimumQuantity(Long minimumQuantity)

      The minimum quantity this price tier is valid for.

      Parameters:
      minimumQuantity - value to be set
    • setValue

      void setValue(TypedMoney value)

      The currency of a price tier is always the same as the currency of the base Price.

      Parameters:
      value - value to be set
    • of

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

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

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

      static PriceTierBuilder builder()
      builder factory method for PriceTier
      Returns:
      builder
    • builder

      static PriceTierBuilder builder(PriceTier template)
      create builder for PriceTier instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withPriceTier

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