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
-
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.true
if thestaged
data is different from thecurrent
data.true
if the Product is published.Staged (unpublished) data of the Product.hasStagedChanges
(Boolean hasStagedChanges) true
if thestaged
data is different from thecurrent
data.static ProductCatalogDataBuilder
of()
factory method for an instance of ProductCatalogDataBuilderstatic ProductCatalogDataBuilder
of
(ProductCatalogData template) create builder for ProductCatalogData instancetrue
if 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
true
if 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
true
if thestaged
data is different from thecurrent
data.- Parameters:
hasStagedChanges
- value to be set- Returns:
- Builder
-
getPublished
true
if 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
true
if thestaged
data is different from thecurrent
data.- Returns:
- hasStagedChanges
-
build
builds ProductCatalogData with checking for non-null required values- Specified by:
build
in 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
-