Class CartScoreTierBuilder

java.lang.Object
com.commercetools.api.models.shipping_method.CartScoreTierBuilder
All Implemented Interfaces:
Builder<CartScoreTier>

public class CartScoreTierBuilder extends Object implements Builder<CartScoreTier>
CartScoreTierBuilder
Example to create an instance using the builder pattern

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

    • CartScoreTierBuilder

      public CartScoreTierBuilder()
  • Method Details

    • score

      public CartScoreTierBuilder score(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
      Returns:
      Builder
    • price

      Defines a fixed price for the score.

      Parameters:
      builder - function to build the price value
      Returns:
      Builder
    • withPrice

      public CartScoreTierBuilder withPrice(Function<MoneyBuilder,Money> builder)

      Defines a fixed price for the score.

      Parameters:
      builder - function to build the price value
      Returns:
      Builder
    • price

      public CartScoreTierBuilder price(@Nullable Money price)

      Defines a fixed price for the score.

      Parameters:
      price - value to be set
      Returns:
      Builder
    • priceFunction

      Dynamically calculates a Price for a range of scores.

      Parameters:
      builder - function to build the priceFunction value
      Returns:
      Builder
    • withPriceFunction

      public CartScoreTierBuilder withPriceFunction(Function<PriceFunctionBuilder,PriceFunction> builder)

      Dynamically calculates a Price for a range of scores.

      Parameters:
      builder - function to build the priceFunction value
      Returns:
      Builder
    • priceFunction

      public CartScoreTierBuilder priceFunction(@Nullable PriceFunction priceFunction)

      Dynamically calculates a Price for a range of scores.

      Parameters:
      priceFunction - value to be set
      Returns:
      Builder
    • isMatching

      public CartScoreTierBuilder isMatching(@Nullable 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
      Returns:
      Builder
    • getScore

      public 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

      @Nullable public Money getPrice()

      Defines a fixed price for the score.

      Returns:
      price
    • getPriceFunction

      @Nullable public PriceFunction getPriceFunction()

      Dynamically calculates a Price for a range of scores.

      Returns:
      priceFunction
    • getIsMatching

      @Nullable public Boolean getIsMatching()

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

      Returns:
      isMatching
    • build

      public CartScoreTier build()
      builds CartScoreTier with checking for non-null required values
      Specified by:
      build in interface Builder<CartScoreTier>
      Returns:
      CartScoreTier
    • buildUnchecked

      public CartScoreTier buildUnchecked()
      builds CartScoreTier without checking for non-null required values
      Returns:
      CartScoreTier
    • of

      public static CartScoreTierBuilder of()
      factory method for an instance of CartScoreTierBuilder
      Returns:
      builder
    • of

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