Interface CartValueTier

All Superinterfaces:
ShippingRatePriceTier

public interface CartValueTier extends ShippingRatePriceTier

The ShippingRate maps to the value of the Cart and is used to select a tier. The value of the Cart is the sum of all Line Item totals and Custom Line Item totals (via the totalPrice field) after any Product Discounts and Cart Discounts have been applied. If chosen, it is not possible to set a value for the shippingRateInput on the Cart. Tiers contain the centAmount (a value of 100 in the currency USD corresponds to $ 1.00), and start at 1.'


Example to create an instance using the builder pattern

     CartValueTier cartValueTier = CartValueTier.builder()
             .minimumCentAmount(1)
             .price(priceBuilder -> priceBuilder)
             .build()
 
  • Field Details

  • Method Details

    • getMinimumCentAmount

      @NotNull @NotNull Long getMinimumCentAmount()

      Minimum total price of a Cart for which a shipping rate applies.

      Returns:
      minimumCentAmount
    • getPrice

      @NotNull @Valid @NotNull @Valid Money getPrice()

      Fixed shipping rate Price for a CartValue.

      Returns:
      price
    • getIsMatching

      Boolean getIsMatching()

      Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

      Returns:
      isMatching
    • setMinimumCentAmount

      void setMinimumCentAmount(Long minimumCentAmount)

      Minimum total price of a Cart for which a shipping rate applies.

      Parameters:
      minimumCentAmount - value to be set
    • setPrice

      void setPrice(Money price)

      Fixed shipping rate Price for a CartValue.

      Parameters:
      price - value to be set
    • setIsMatching

      void setIsMatching(Boolean isMatching)

      Appears in response to Get ShippingMethods for a Cart if the shipping rate matches the search query.

      Parameters:
      isMatching - value to be set
    • of

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

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

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

      static CartValueTierBuilder builder()
      builder factory method for CartValueTier
      Returns:
      builder
    • builder

      static CartValueTierBuilder builder(CartValueTier template)
      create builder for CartValueTier instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCartValueTier

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