Interface CartScoreTier

All Superinterfaces:
ShippingRatePriceTier

public interface CartScoreTier extends ShippingRatePriceTier

The ShippingRate maps to an abstract Cart categorization expressed by integers (such as shipping scores or weight ranges). Either price or priceFunction is required.


Example to create an instance using the builder pattern

     CartScoreTier cartScoreTier = CartScoreTier.builder()
             .score(0.3)
             .build()
 
  • Field Details

  • Method Details

    • getScore

      @NotNull @NotNull Integer getScore()

      Abstract value for categorizing a Cart. The range starts at 0. The default price covers 0, tiers start at 1. See Tiered shipping rates for details and examples.

      Returns:
      score
    • getPrice

      @Valid @Valid Money getPrice()

      Defines a fixed price for the score.

      Returns:
      price
    • getPriceFunction

      @Valid @Valid PriceFunction getPriceFunction()

      Dynamically calculates a Price for a range of scores.

      Returns:
      priceFunction
    • getIsMatching

      Boolean getIsMatching()

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

      Returns:
      isMatching
    • setScore

      void setScore(Integer score)

      Abstract value for categorizing a Cart. The range starts at 0. The default price covers 0, tiers start at 1. See Tiered shipping rates for details and examples.

      Parameters:
      score - value to be set
    • setPrice

      void setPrice(Money price)

      Defines a fixed price for the score.

      Parameters:
      price - value to be set
    • setPriceFunction

      void setPriceFunction(PriceFunction priceFunction)

      Dynamically calculates a Price for a range of scores.

      Parameters:
      priceFunction - 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 CartScoreTier of()
      factory method
      Returns:
      instance of CartScoreTier
    • of

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

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

      static CartScoreTierBuilder builder()
      builder factory method for CartScoreTier
      Returns:
      builder
    • builder

      static CartScoreTierBuilder builder(CartScoreTier template)
      create builder for CartScoreTier instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCartScoreTier

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