Class TaxPortionBuilder

java.lang.Object
com.commercetools.importapi.models.orders.TaxPortionBuilder
All Implemented Interfaces:
Builder<TaxPortion>

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

     TaxPortion taxPortion = TaxPortion.builder()
             .rate(0.3)
             .amount(amountBuilder -> amountBuilder)
             .build()
 
  • Constructor Details

    • TaxPortionBuilder

      public TaxPortionBuilder()
  • Method Details

    • name

      public TaxPortionBuilder name(@Nullable String name)
      set the value to the name
      Parameters:
      name - value to be set
      Returns:
      Builder
    • rate

      public TaxPortionBuilder rate(Double rate)
      set the value to the rate
      Parameters:
      rate - value to be set
      Returns:
      Builder
    • amount

      public TaxPortionBuilder amount(TypedMoney amount)
      set the value to the amount
      Parameters:
      amount - value to be set
      Returns:
      Builder
    • amount

      public TaxPortionBuilder amount(Function<TypedMoneyBuilder,Builder<? extends TypedMoney>> builder)
      set the value to the amount using the builder function
      Parameters:
      builder - function to build the amount value
      Returns:
      Builder
    • getName

      @Nullable public String getName()
      value of name}
      Returns:
      name
    • getRate

      public Double getRate()
      value of rate}
      Returns:
      rate
    • getAmount

      public TypedMoney getAmount()
      value of amount}
      Returns:
      amount
    • build

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

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

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

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