Class TaxPortionBuilder

java.lang.Object
com.commercetools.api.models.cart.TaxPortionBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<TaxPortion>

public class TaxPortionBuilder extends Object implements io.vrap.rmf.base.client.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)

      Name of the tax portion.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • rate

      public TaxPortionBuilder rate(Double rate)

      A number in the range 0-1.

      Parameters:
      rate - value to be set
      Returns:
      Builder
    • amount

      Money value of the tax portion.

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

      Money value of the tax portion.

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

      public TaxPortionBuilder amount(CentPrecisionMoney amount)

      Money value of the tax portion.

      Parameters:
      amount - value to be set
      Returns:
      Builder
    • getName

      @Nullable public String getName()

      Name of the tax portion.

      Returns:
      name
    • getRate

      public Double getRate()

      A number in the range 0-1.

      Returns:
      rate
    • getAmount

      public CentPrecisionMoney getAmount()

      Money value of the tax portion.

      Returns:
      amount
    • build

      public TaxPortion build()
      builds TaxPortion with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.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