Class MethodTaxRateBuilder

java.lang.Object
com.commercetools.api.models.cart.MethodTaxRateBuilder
All Implemented Interfaces:
Builder<MethodTaxRate>

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

     MethodTaxRate methodTaxRate = MethodTaxRate.builder()
             .shippingMethodKey("{shippingMethodKey}")
             .build()
 
  • Constructor Details

    • MethodTaxRateBuilder

      public MethodTaxRateBuilder()
  • Method Details

    • shippingMethodKey

      public MethodTaxRateBuilder shippingMethodKey(String shippingMethodKey)

      User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

      Parameters:
      shippingMethodKey - value to be set
      Returns:
      Builder
    • taxRate

      Tax Rate for the Shipping Method.

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

      public MethodTaxRateBuilder withTaxRate(Function<TaxRateBuilder,TaxRate> builder)

      Tax Rate for the Shipping Method.

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

      public MethodTaxRateBuilder taxRate(@Nullable TaxRate taxRate)

      Tax Rate for the Shipping Method.

      Parameters:
      taxRate - value to be set
      Returns:
      Builder
    • getShippingMethodKey

      public String getShippingMethodKey()

      User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

      Returns:
      shippingMethodKey
    • getTaxRate

      @Nullable public TaxRate getTaxRate()

      Tax Rate for the Shipping Method.

      Returns:
      taxRate
    • build

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

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

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

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