Class ProductTailoringBuilder

java.lang.Object
com.commercetools.api.models.product_tailoring.ProductTailoringBuilder
All Implemented Interfaces:
Builder<ProductTailoring>

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

     ProductTailoring productTailoring = ProductTailoring.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .store(storeBuilder -> storeBuilder)
             .product(productBuilder -> productBuilder)
             .published(true)
             .current(currentBuilder -> currentBuilder)
             .staged(stagedBuilder -> stagedBuilder)
             .hasStagedChanges(true)
             .build()
 
  • Constructor Details

    • ProductTailoringBuilder

      public ProductTailoringBuilder()
  • Method Details

    • id

      Unique identifier of the ProductTailoring.

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

      public ProductTailoringBuilder version(Long version)

      Current version of the ProductTailoring.

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

      public ProductTailoringBuilder createdAt(ZonedDateTime createdAt)

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

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

      public ProductTailoringBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

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

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

      IDs and references that last modified the ProductTailoring.

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

      IDs and references that last modified the ProductTailoring.

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

      public ProductTailoringBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the ProductTailoring.

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

      IDs and references that created the ProductTailoring.

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

      IDs and references that created the ProductTailoring.

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

      public ProductTailoringBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the ProductTailoring.

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

      User-defined unique identifier of the ProductTailoring.

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

      The Store to which the ProductTailoring belongs.

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

      The Store to which the ProductTailoring belongs.

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

      The Store to which the ProductTailoring belongs.

      Parameters:
      store - value to be set
      Returns:
      Builder
    • product

      Reference to the Product the ProductTailoring belongs to.

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

      Reference to the Product the ProductTailoring belongs to.

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

      public ProductTailoringBuilder product(ProductReference product)

      Reference to the Product the ProductTailoring belongs to.

      Parameters:
      product - value to be set
      Returns:
      Builder
    • published

      public ProductTailoringBuilder published(Boolean published)

      If true, the tailored information contained in the current ProductTailoringData is provided when retrieving the ProductProjection in Store. For information not part of the ProductTailoringData, the original information contained in the ProductData is provided. If false, only the original information contained in the ProductData is provided.

      Parameters:
      published - value to be set
      Returns:
      Builder
    • current

      Current (published) data of the ProductTailoring.

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

      Current (published) data of the ProductTailoring.

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

      Current (published) data of the ProductTailoring.

      Parameters:
      current - value to be set
      Returns:
      Builder
    • staged

      Staged (unpublished) data of the ProductTailoring.

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

      Staged (unpublished) data of the ProductTailoring.

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

      Staged (unpublished) data of the ProductTailoring.

      Parameters:
      staged - value to be set
      Returns:
      Builder
    • hasStagedChanges

      public ProductTailoringBuilder hasStagedChanges(Boolean hasStagedChanges)

      true if the staged data is different from the current data.

      Parameters:
      hasStagedChanges - value to be set
      Returns:
      Builder
    • warnings

      public ProductTailoringBuilder warnings(@Nullable WarningObject... warnings)

      Warnings about processing of a request. Appears in response to requests with response status code 202 Accepted.

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

      public ProductTailoringBuilder warnings(@Nullable List<WarningObject> warnings)

      Warnings about processing of a request. Appears in response to requests with response status code 202 Accepted.

      Parameters:
      warnings - value to be set
      Returns:
      Builder
    • plusWarnings

      public ProductTailoringBuilder plusWarnings(@Nullable WarningObject... warnings)

      Warnings about processing of a request. Appears in response to requests with response status code 202 Accepted.

      Parameters:
      warnings - value to be set
      Returns:
      Builder
    • plusWarnings

      public ProductTailoringBuilder plusWarnings(Function<WarningObjectBuilder,Builder<? extends WarningObject>> builder)

      Warnings about processing of a request. Appears in response to requests with response status code 202 Accepted.

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

      public ProductTailoringBuilder withWarnings(Function<WarningObjectBuilder,Builder<? extends WarningObject>> builder)

      Warnings about processing of a request. Appears in response to requests with response status code 202 Accepted.

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

      public String getId()

      Unique identifier of the ProductTailoring.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the ProductTailoring.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

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

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

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

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the ProductTailoring.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the ProductTailoring.

      Returns:
      createdBy
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the ProductTailoring.

      Returns:
      key
    • getStore

      public StoreKeyReference getStore()

      The Store to which the ProductTailoring belongs.

      Returns:
      store
    • getProduct

      public ProductReference getProduct()

      Reference to the Product the ProductTailoring belongs to.

      Returns:
      product
    • getPublished

      public Boolean getPublished()

      If true, the tailored information contained in the current ProductTailoringData is provided when retrieving the ProductProjection in Store. For information not part of the ProductTailoringData, the original information contained in the ProductData is provided. If false, only the original information contained in the ProductData is provided.

      Returns:
      published
    • getCurrent

      public ProductTailoringData getCurrent()

      Current (published) data of the ProductTailoring.

      Returns:
      current
    • getStaged

      public ProductTailoringData getStaged()

      Staged (unpublished) data of the ProductTailoring.

      Returns:
      staged
    • getHasStagedChanges

      public Boolean getHasStagedChanges()

      true if the staged data is different from the current data.

      Returns:
      hasStagedChanges
    • getWarnings

      @Nullable public List<WarningObject> getWarnings()

      Warnings about processing of a request. Appears in response to requests with response status code 202 Accepted.

      Returns:
      warnings
    • build

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

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

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

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