Class TaxCategoryDraftBuilder

java.lang.Object
com.commercetools.api.models.tax_category.TaxCategoryDraftBuilder
All Implemented Interfaces:
Builder<TaxCategoryDraft>

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

     TaxCategoryDraft taxCategoryDraft = TaxCategoryDraft.builder()
             .name("{name}")
             .build()
 
  • Constructor Details

    • TaxCategoryDraftBuilder

      public TaxCategoryDraftBuilder()
  • Method Details

    • name

      public TaxCategoryDraftBuilder name(String name)

      Name of the TaxCategory.

      If the provided name is used by another TaxCategory in the Project, an InvalidOperation error is returned.

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

      public TaxCategoryDraftBuilder description(@Nullable String description)

      Description of the TaxCategory.

      Parameters:
      description - value to be set
      Returns:
      Builder
    • rates

      public TaxCategoryDraftBuilder rates(@Nullable TaxRateDraft... rates)

      Tax rates and subrates of states and countries.

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

      public TaxCategoryDraftBuilder rates(@Nullable List<TaxRateDraft> rates)

      Tax rates and subrates of states and countries.

      Parameters:
      rates - value to be set
      Returns:
      Builder
    • plusRates

      public TaxCategoryDraftBuilder plusRates(@Nullable TaxRateDraft... rates)

      Tax rates and subrates of states and countries.

      Parameters:
      rates - value to be set
      Returns:
      Builder
    • plusRates

      Tax rates and subrates of states and countries.

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

      Tax rates and subrates of states and countries.

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

      Tax rates and subrates of states and countries.

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

      Tax rates and subrates of states and countries.

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

      public TaxCategoryDraftBuilder key(@Nullable String key)

      User-defined unique identifier for the TaxCategory.

      If the value is used by another TaxCategory in the Project, a DuplicateField error is returned.

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

      public String getName()

      Name of the TaxCategory.

      If the provided name is used by another TaxCategory in the Project, an InvalidOperation error is returned.

      Returns:
      name
    • getDescription

      @Nullable public String getDescription()

      Description of the TaxCategory.

      Returns:
      description
    • getRates

      @Nullable public List<TaxRateDraft> getRates()

      Tax rates and subrates of states and countries.

      Returns:
      rates
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the TaxCategory.

      If the value is used by another TaxCategory in the Project, a DuplicateField error is returned.

      Returns:
      key
    • build

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

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

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

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