Class TaxCategoryBuilder

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

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

     TaxCategory taxCategory = TaxCategory.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .name("{name}")
             .plusRates(ratesBuilder -> ratesBuilder)
             .build()
 
  • Constructor Details

    • TaxCategoryBuilder

      public TaxCategoryBuilder()
  • Method Details

    • id

      public TaxCategoryBuilder id(String id)

      Unique identifier of the TaxCategory.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public TaxCategoryBuilder version(Long version)

      Current version of the TaxCategory.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      public TaxCategoryBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the TaxCategory was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public TaxCategoryBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the TaxCategory was last updated.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • lastModifiedBy

      IDs and references that last modified the TaxCategory.

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

      public TaxCategoryBuilder withLastModifiedBy(Function<LastModifiedByBuilder,LastModifiedBy> builder)

      IDs and references that last modified the TaxCategory.

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

      public TaxCategoryBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the TaxCategory.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      IDs and references that created the TaxCategory.

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

      public TaxCategoryBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      IDs and references that created the TaxCategory.

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

      public TaxCategoryBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the TaxCategory.

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

      public TaxCategoryBuilder name(String name)

      Name of the TaxCategory.

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

      public TaxCategoryBuilder description(@Nullable String description)

      Description of the TaxCategory.

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

      public TaxCategoryBuilder rates(TaxRate... rates)

      Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

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

      public TaxCategoryBuilder rates(List<TaxRate> rates)

      Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

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

      public TaxCategoryBuilder plusRates(TaxRate... rates)

      Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

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

      Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

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

      Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

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

      public TaxCategoryBuilder addRates(Function<TaxRateBuilder,TaxRate> builder)

      Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

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

      public TaxCategoryBuilder setRates(Function<TaxRateBuilder,TaxRate> builder)

      Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

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

      User-defined unique identifier of the TaxCategory.

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

      public String getId()

      Unique identifier of the TaxCategory.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the TaxCategory.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the TaxCategory was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the TaxCategory was last updated.

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the TaxCategory.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the TaxCategory.

      Returns:
      createdBy
    • getName

      public String getName()

      Name of the TaxCategory.

      Returns:
      name
    • getDescription

      @Nullable public String getDescription()

      Description of the TaxCategory.

      Returns:
      description
    • getRates

      public List<TaxRate> getRates()

      Tax rates and subrates of states and countries. Each TaxRate in the array has a unique ID.

      Returns:
      rates
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the TaxCategory.

      Returns:
      key
    • build

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

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

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

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