Class CartValueTierBuilder

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

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

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

    • CartValueTierBuilder

      public CartValueTierBuilder()
  • Method Details

    • minimumCentAmount

      public CartValueTierBuilder minimumCentAmount(Long minimumCentAmount)

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

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

      Fixed shipping rate Price for a CartValue.

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

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

      Fixed shipping rate Price for a CartValue.

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

      public CartValueTierBuilder price(Money price)

      Fixed shipping rate Price for a CartValue.

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

      public CartValueTierBuilder 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
    • getMinimumCentAmount

      public Long getMinimumCentAmount()

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

      Returns:
      minimumCentAmount
    • getPrice

      public Money getPrice()

      Fixed shipping rate Price for a CartValue.

      Returns:
      price
    • 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 CartValueTier build()
      builds CartValueTier with checking for non-null required values
      Specified by:
      build in interface Builder<CartValueTier>
      Returns:
      CartValueTier
    • buildUnchecked

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

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

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