Class PriceTierBuilder

java.lang.Object
com.commercetools.importapi.models.common.PriceTierBuilder
All Implemented Interfaces:
Builder<PriceTier>

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

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

    • PriceTierBuilder

      public PriceTierBuilder()
  • Method Details

    • minimumQuantity

      public PriceTierBuilder minimumQuantity(Long minimumQuantity)

      The minimum quantity this price tier is valid for.

      Parameters:
      minimumQuantity - value to be set
      Returns:
      Builder
    • value

      public PriceTierBuilder value(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
      Returns:
      Builder
    • value

      public PriceTierBuilder value(Function<TypedMoneyBuilder,Builder<? extends TypedMoney>> builder)

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

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

      public Long getMinimumQuantity()

      The minimum quantity this price tier is valid for.

      Returns:
      minimumQuantity
    • getValue

      public TypedMoney getValue()

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

      Returns:
      value
    • build

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

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

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

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