Class ProductBuilder
Example to create an instance using the builder pattern
Product product = Product.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.productType(productTypeBuilder -> productTypeBuilder)
.masterData(masterDataBuilder -> masterDataBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds Product with checking for non-null required valuesbuilds Product without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Product was initially created.IDs and references that created the Product.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the Product.Date and time (UTC) the Product was initially created.IDs and references that created the Product.getId()
Unique identifier of the Product.getKey()
User-defined unique identifier of the Product.Date and time (UTC) the Product was last updated.IDs and references that last modified the Product.Contains the current and the staged representation of the product information.Type of Price to be used when looking up a price for the Product.The Product Type defining the Attributes of the Product.Review statistics of the Product.getState()
State of the Product.The TaxCategory of the Product.Current version of the Product.Warnings about processing of a request.Unique identifier of the Product.User-defined unique identifier of the Product.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Product was last updated.lastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the Product.IDs and references that last modified the Product.masterData
(ProductCatalogData masterData) Contains the current and the staged representation of the product information.Contains the current and the staged representation of the product information.static ProductBuilder
of()
factory method for an instance of ProductBuilderstatic ProductBuilder
create builder for Product instanceplusWarnings
(WarningObject... warnings) Warnings about processing of a request.plusWarnings
(Function<WarningObjectBuilder, Builder<? extends WarningObject>> builder) Warnings about processing of a request.priceMode
(ProductPriceModeEnum priceMode) Type of Price to be used when looking up a price for the Product.productType
(ProductTypeReference productType) The Product Type defining the Attributes of the Product.The Product Type defining the Attributes of the Product.reviewRatingStatistics
(ReviewRatingStatistics reviewRatingStatistics) Review statistics of the Product.reviewRatingStatistics
(Function<ReviewRatingStatisticsBuilder, ReviewRatingStatisticsBuilder> builder) Review statistics of the Product.state
(StateReference state) State of the Product.State of the Product.taxCategory
(TaxCategoryReference taxCategory) The TaxCategory of the Product.The TaxCategory of the Product.Current version of the Product.warnings
(WarningObject... warnings) Warnings about processing of a request.warnings
(List<WarningObject> warnings) Warnings about processing of a request.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the Product.IDs and references that last modified the Product.Contains the current and the staged representation of the product information.The Product Type defining the Attributes of the Product.Review statistics of the Product.withState
(Function<StateReferenceBuilder, StateReference> builder) State of the Product.The TaxCategory of the Product.withWarnings
(Function<WarningObjectBuilder, Builder<? extends WarningObject>> builder) Warnings about processing of a request.
-
Constructor Details
-
ProductBuilder
public ProductBuilder()
-
-
Method Details
-
id
Unique identifier of the Product.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the Product.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Product was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the Product was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the Product.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
IDs and references that last modified the Product.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the Product.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the Product.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the Product.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the Product.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Product.
This is different from the
key
of a ProductVariant.- Parameters:
key
- value to be set- Returns:
- Builder
-
productType
public ProductBuilder productType(Function<ProductTypeReferenceBuilder, ProductTypeReferenceBuilder> builder) The Product Type defining the Attributes of the Product. Cannot be changed.
- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
withProductType
public ProductBuilder withProductType(Function<ProductTypeReferenceBuilder, ProductTypeReference> builder) The Product Type defining the Attributes of the Product. Cannot be changed.
- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
productType
The Product Type defining the Attributes of the Product. Cannot be changed.
- Parameters:
productType
- value to be set- Returns:
- Builder
-
masterData
public ProductBuilder masterData(Function<ProductCatalogDataBuilder, ProductCatalogDataBuilder> builder) Contains the current and the staged representation of the product information.
- Parameters:
builder
- function to build the masterData value- Returns:
- Builder
-
withMasterData
public ProductBuilder withMasterData(Function<ProductCatalogDataBuilder, ProductCatalogData> builder) Contains the current and the staged representation of the product information.
- Parameters:
builder
- function to build the masterData value- Returns:
- Builder
-
masterData
Contains the current and the staged representation of the product information.
- Parameters:
masterData
- value to be set- Returns:
- Builder
-
taxCategory
public ProductBuilder taxCategory(Function<TaxCategoryReferenceBuilder, TaxCategoryReferenceBuilder> builder) The TaxCategory of the Product.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
withTaxCategory
public ProductBuilder withTaxCategory(Function<TaxCategoryReferenceBuilder, TaxCategoryReference> builder) The TaxCategory of the Product.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
taxCategory
The TaxCategory of the Product.
- Parameters:
taxCategory
- value to be set- Returns:
- Builder
-
state
State of the Product.
- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
withState
State of the Product.
- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
state
State of the Product.
- Parameters:
state
- value to be set- Returns:
- Builder
-
reviewRatingStatistics
public ProductBuilder reviewRatingStatistics(Function<ReviewRatingStatisticsBuilder, ReviewRatingStatisticsBuilder> builder) Review statistics of the Product.
- Parameters:
builder
- function to build the reviewRatingStatistics value- Returns:
- Builder
-
withReviewRatingStatistics
public ProductBuilder withReviewRatingStatistics(Function<ReviewRatingStatisticsBuilder, ReviewRatingStatistics> builder) Review statistics of the Product.
- Parameters:
builder
- function to build the reviewRatingStatistics value- Returns:
- Builder
-
reviewRatingStatistics
public ProductBuilder reviewRatingStatistics(@Nullable ReviewRatingStatistics reviewRatingStatistics) Review statistics of the Product.
- Parameters:
reviewRatingStatistics
- value to be set- Returns:
- Builder
-
priceMode
Type of Price to be used when looking up a price for the Product.
- Parameters:
priceMode
- value to be set- Returns:
- Builder
-
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
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
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 ProductBuilder 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 ProductBuilder 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
Unique identifier of the Product.
- Returns:
- id
-
getVersion
Current version of the Product.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Product was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Product was last updated.
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the Product.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Product.
- Returns:
- createdBy
-
getKey
User-defined unique identifier of the Product.
This is different from the
key
of a ProductVariant.- Returns:
- key
-
getProductType
The Product Type defining the Attributes of the Product. Cannot be changed.
- Returns:
- productType
-
getMasterData
Contains the current and the staged representation of the product information.
- Returns:
- masterData
-
getTaxCategory
The TaxCategory of the Product.
- Returns:
- taxCategory
-
getState
State of the Product.
- Returns:
- state
-
getReviewRatingStatistics
Review statistics of the Product.
- Returns:
- reviewRatingStatistics
-
getPriceMode
Type of Price to be used when looking up a price for the Product.
- Returns:
- priceMode
-
getWarnings
Warnings about processing of a request. Appears in response to requests with response status code
202 Accepted
.- Returns:
- warnings
-
build
builds Product with checking for non-null required values -
buildUnchecked
builds Product without checking for non-null required values- Returns:
- Product
-
of
factory method for an instance of ProductBuilder- Returns:
- builder
-
of
create builder for Product instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-