Class ProductCatalogDataBuilder
java.lang.Object
com.commercetools.api.models.product.ProductCatalogDataBuilder
- All Implemented Interfaces:
Builder<ProductCatalogData>
ProductCatalogDataBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
ProductCatalogData productCatalogData = ProductCatalogData.builder()
.published(true)
.current(currentBuilder -> currentBuilder)
.staged(stagedBuilder -> stagedBuilder)
.hasStagedChanges(true)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds ProductCatalogData with checking for non-null required valuesbuilds ProductCatalogData without checking for non-null required valuescurrent(ProductData current) Current (published) data of the Product.current(Function<ProductDataBuilder, ProductDataBuilder> builder) Current (published) data of the Product.Current (published) data of the Product.trueif thestageddata is different from thecurrentdata.trueif the Product is published.Staged (unpublished) data of the Product.hasStagedChanges(Boolean hasStagedChanges) trueif thestageddata is different from thecurrentdata.static ProductCatalogDataBuilderof()factory method for an instance of ProductCatalogDataBuilderstatic ProductCatalogDataBuilderof(ProductCatalogData template) create builder for ProductCatalogData instancetrueif the Product is published.staged(ProductData staged) Staged (unpublished) data of the Product.staged(Function<ProductDataBuilder, ProductDataBuilder> builder) Staged (unpublished) data of the Product.withCurrent(Function<ProductDataBuilder, ProductData> builder) Current (published) data of the Product.withStaged(Function<ProductDataBuilder, ProductData> builder) Staged (unpublished) data of the Product.
-
Constructor Details
-
ProductCatalogDataBuilder
public ProductCatalogDataBuilder()
-
-
Method Details
-
published
trueif the Product is published.- Parameters:
published- value to be set- Returns:
- Builder
-
current
Current (published) data of the Product.
- Parameters:
builder- function to build the current value- Returns:
- Builder
-
withCurrent
Current (published) data of the Product.
- Parameters:
builder- function to build the current value- Returns:
- Builder
-
current
Current (published) data of the Product.
- Parameters:
current- value to be set- Returns:
- Builder
-
staged
Staged (unpublished) data of the Product.
- Parameters:
builder- function to build the staged value- Returns:
- Builder
-
withStaged
Staged (unpublished) data of the Product.
- Parameters:
builder- function to build the staged value- Returns:
- Builder
-
staged
Staged (unpublished) data of the Product.
- Parameters:
staged- value to be set- Returns:
- Builder
-
hasStagedChanges
trueif thestageddata is different from thecurrentdata.- Parameters:
hasStagedChanges- value to be set- Returns:
- Builder
-
getPublished
trueif the Product is published.- Returns:
- published
-
getCurrent
Current (published) data of the Product.
- Returns:
- current
-
getStaged
Staged (unpublished) data of the Product.
- Returns:
- staged
-
getHasStagedChanges
trueif thestageddata is different from thecurrentdata.- Returns:
- hasStagedChanges
-
build
builds ProductCatalogData with checking for non-null required values- Specified by:
buildin interfaceBuilder<ProductCatalogData>- Returns:
- ProductCatalogData
-
buildUnchecked
builds ProductCatalogData without checking for non-null required values- Returns:
- ProductCatalogData
-
of
factory method for an instance of ProductCatalogDataBuilder- Returns:
- builder
-
of
create builder for ProductCatalogData instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-