Class ProductProjectionBuilder
- All Implemented Interfaces:
Builder<ProductProjection>
Example to create an instance using the builder pattern
ProductProjection productProjection = ProductProjection.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)
.name(nameBuilder -> nameBuilder)
.slug(slugBuilder -> slugBuilder)
.plusCategories(categoriesBuilder -> categoriesBuilder)
.masterVariant(masterVariantBuilder -> masterVariantBuilder)
.plusVariants(variantsBuilder -> variantsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCategories assigned to the Product.Additional Product Variants.build()
builds ProductProjection with checking for non-null required valuesbuilds ProductProjection without checking for non-null required valuescategories
(CategoryReference... categories) Categories assigned to the Product.categories
(List<CategoryReference> categories) Categories assigned to the Product.categoryOrderHints
(CategoryOrderHints categoryOrderHints) Order of Product in Categories.Order of Product in Categories.createdAt
(ZonedDateTime createdAt) Date and time (UTC) the ProductProjection was initially created.description
(LocalizedString description) Description of the Product.Description of the Product.Categories assigned to the Product.Order of Product in Categories.Date and time (UTC) the ProductProjection was initially created.Description of the Product.true
if the staged data is different from the current data.getId()
Unique identifier of the Product.getKey()
User-defined unique identifier of the Product.Date and time (UTC) the ProductProjection was last updated.The Master Variant of the Product.Description of the Product displayed in search results below the meta title.Keywords that give additional information about the Product to search engines.Title of the Product displayed in search results.getName()
Name of the Product.Indicates whether the Prices of the Product Projection are embedded or standalone.The ProductType defining the Attributes of the Product.true
if the Product is published.Review statistics of the Product.Used by Product Suggestions, but is also considered for a full text search.getSlug()
User-defined identifier used in a deep-link URL for the Product.getState()
State of the Product.The TaxCategory of the Product.Additional Product Variants.Current version of the Product.hasStagedChanges
(Boolean hasStagedChanges) true
if the staged data is different from the current data.Unique identifier of the Product.User-defined unique identifier of the Product.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the ProductProjection was last updated.masterVariant
(ProductVariant masterVariant) The Master Variant of the Product.The Master Variant of the Product.metaDescription
(LocalizedString metaDescription) Description of the Product displayed in search results below the meta title.Description of the Product displayed in search results below the meta title.metaKeywords
(LocalizedString metaKeywords) Keywords that give additional information about the Product to search engines.Keywords that give additional information about the Product to search engines.metaTitle
(LocalizedString metaTitle) Title of the Product displayed in search results.Title of the Product displayed in search results.name
(LocalizedString name) Name of the Product.Name of the Product.static ProductProjectionBuilder
of()
factory method for an instance of ProductProjectionBuilderstatic ProductProjectionBuilder
of
(ProductProjection template) create builder for ProductProjection instanceplusCategories
(CategoryReference... categories) Categories assigned to the Product.Categories assigned to the Product.plusVariants
(ProductVariant... variants) Additional Product Variants.Additional Product Variants.priceMode
(ProductPriceModeEnum priceMode) Indicates whether the Prices of the Product Projection are embedded or standalone.productType
(ProductTypeReference productType) The ProductType defining the Attributes of the Product.The ProductType defining the Attributes of the Product.true
if the Product is published.reviewRatingStatistics
(ReviewRatingStatistics reviewRatingStatistics) Review statistics of the Product.reviewRatingStatistics
(Function<ReviewRatingStatisticsBuilder, ReviewRatingStatisticsBuilder> builder) Review statistics of the Product.searchKeywords
(SearchKeywords searchKeywords) Used by Product Suggestions, but is also considered for a full text search.Used by Product Suggestions, but is also considered for a full text search.Categories assigned to the Product.Additional Product Variants.slug
(LocalizedString slug) User-defined identifier used in a deep-link URL for the Product.User-defined identifier used in a deep-link URL for 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.variants
(ProductVariant... variants) Additional Product Variants.variants
(List<ProductVariant> variants) Additional Product Variants.Current version of the Product.Categories assigned to the Product.Order of Product in Categories.Description of the Product.The Master Variant of the Product.Description of the Product displayed in search results below the meta title.Keywords that give additional information about the Product to search engines.Title of the Product displayed in search results.Name of the Product.The ProductType defining the Attributes of the Product.Review statistics of the Product.Used by Product Suggestions, but is also considered for a full text search.User-defined identifier used in a deep-link URL for the Product.withState
(Function<StateReferenceBuilder, StateReference> builder) State of the Product.The TaxCategory of the Product.Additional Product Variants.
-
Constructor Details
-
ProductProjectionBuilder
public ProductProjectionBuilder()
-
-
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 ProductProjection was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the ProductProjection was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Product.
- Parameters:
key
- value to be set- Returns:
- Builder
-
productType
public ProductProjectionBuilder productType(Function<ProductTypeReferenceBuilder, ProductTypeReferenceBuilder> builder) The ProductType defining the Attributes of the Product.
- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
withProductType
public ProductProjectionBuilder withProductType(Function<ProductTypeReferenceBuilder, ProductTypeReference> builder) The ProductType defining the Attributes of the Product.
- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
productType
The ProductType defining the Attributes of the Product.
- Parameters:
productType
- value to be set- Returns:
- Builder
-
name
public ProductProjectionBuilder name(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Name of the Product.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
Name of the Product.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
Name of the Product.
- Parameters:
name
- value to be set- Returns:
- Builder
-
description
public ProductProjectionBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the Product.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
public ProductProjectionBuilder withDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Description of the Product.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
description
Description of the Product.
- Parameters:
description
- value to be set- Returns:
- Builder
-
slug
public ProductProjectionBuilder slug(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) User-defined identifier used in a deep-link URL for the Product. Must be unique across a Project, but can be the same for Products in different locales. Matches the pattern
[a-zA-Z0-9_\-]{2,256}
. For good performance, indexes are provided for the first 15languages
set in the Project.- Parameters:
builder
- function to build the slug value- Returns:
- Builder
-
withSlug
User-defined identifier used in a deep-link URL for the Product. Must be unique across a Project, but can be the same for Products in different locales. Matches the pattern
[a-zA-Z0-9_\-]{2,256}
. For good performance, indexes are provided for the first 15languages
set in the Project.- Parameters:
builder
- function to build the slug value- Returns:
- Builder
-
slug
User-defined identifier used in a deep-link URL for the Product. Must be unique across a Project, but can be the same for Products in different locales. Matches the pattern
[a-zA-Z0-9_\-]{2,256}
. For good performance, indexes are provided for the first 15languages
set in the Project.- Parameters:
slug
- value to be set- Returns:
- Builder
-
categories
Categories assigned to the Product.
- Parameters:
categories
- value to be set- Returns:
- Builder
-
categories
Categories assigned to the Product.
- Parameters:
categories
- value to be set- Returns:
- Builder
-
plusCategories
Categories assigned to the Product.
- Parameters:
categories
- value to be set- Returns:
- Builder
-
plusCategories
public ProductProjectionBuilder plusCategories(Function<CategoryReferenceBuilder, CategoryReferenceBuilder> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
withCategories
public ProductProjectionBuilder withCategories(Function<CategoryReferenceBuilder, CategoryReferenceBuilder> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
addCategories
public ProductProjectionBuilder addCategories(Function<CategoryReferenceBuilder, CategoryReference> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
setCategories
public ProductProjectionBuilder setCategories(Function<CategoryReferenceBuilder, CategoryReference> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
categoryOrderHints
public ProductProjectionBuilder categoryOrderHints(Function<CategoryOrderHintsBuilder, CategoryOrderHintsBuilder> builder) Order of Product in Categories.
- Parameters:
builder
- function to build the categoryOrderHints value- Returns:
- Builder
-
withCategoryOrderHints
public ProductProjectionBuilder withCategoryOrderHints(Function<CategoryOrderHintsBuilder, CategoryOrderHints> builder) Order of Product in Categories.
- Parameters:
builder
- function to build the categoryOrderHints value- Returns:
- Builder
-
categoryOrderHints
Order of Product in Categories.
- Parameters:
categoryOrderHints
- value to be set- Returns:
- Builder
-
metaTitle
public ProductProjectionBuilder metaTitle(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Title of the Product displayed in search results.
- Parameters:
builder
- function to build the metaTitle value- Returns:
- Builder
-
withMetaTitle
public ProductProjectionBuilder withMetaTitle(Function<LocalizedStringBuilder, LocalizedString> builder) Title of the Product displayed in search results.
- Parameters:
builder
- function to build the metaTitle value- Returns:
- Builder
-
metaTitle
Title of the Product displayed in search results.
- Parameters:
metaTitle
- value to be set- Returns:
- Builder
-
metaDescription
public ProductProjectionBuilder metaDescription(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the Product displayed in search results below the meta title.
- Parameters:
builder
- function to build the metaDescription value- Returns:
- Builder
-
withMetaDescription
public ProductProjectionBuilder withMetaDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Description of the Product displayed in search results below the meta title.
- Parameters:
builder
- function to build the metaDescription value- Returns:
- Builder
-
metaDescription
Description of the Product displayed in search results below the meta title.
- Parameters:
metaDescription
- value to be set- Returns:
- Builder
-
metaKeywords
public ProductProjectionBuilder metaKeywords(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Keywords that give additional information about the Product to search engines.
- Parameters:
builder
- function to build the metaKeywords value- Returns:
- Builder
-
withMetaKeywords
public ProductProjectionBuilder withMetaKeywords(Function<LocalizedStringBuilder, LocalizedString> builder) Keywords that give additional information about the Product to search engines.
- Parameters:
builder
- function to build the metaKeywords value- Returns:
- Builder
-
metaKeywords
Keywords that give additional information about the Product to search engines.
- Parameters:
metaKeywords
- value to be set- Returns:
- Builder
-
searchKeywords
public ProductProjectionBuilder searchKeywords(Function<SearchKeywordsBuilder, SearchKeywordsBuilder> builder) Used by Product Suggestions, but is also considered for a full text search.
- Parameters:
builder
- function to build the searchKeywords value- Returns:
- Builder
-
withSearchKeywords
public ProductProjectionBuilder withSearchKeywords(Function<SearchKeywordsBuilder, SearchKeywords> builder) Used by Product Suggestions, but is also considered for a full text search.
- Parameters:
builder
- function to build the searchKeywords value- Returns:
- Builder
-
searchKeywords
Used by Product Suggestions, but is also considered for a full text search.
- Parameters:
searchKeywords
- value to be set- Returns:
- Builder
-
hasStagedChanges
true
if the staged data is different from the current data.- Parameters:
hasStagedChanges
- value to be set- Returns:
- Builder
-
published
true
if the Product is published.- Parameters:
published
- value to be set- Returns:
- Builder
-
masterVariant
public ProductProjectionBuilder masterVariant(Function<ProductVariantBuilder, ProductVariantBuilder> builder) The Master Variant of the Product.
- Parameters:
builder
- function to build the masterVariant value- Returns:
- Builder
-
withMasterVariant
public ProductProjectionBuilder withMasterVariant(Function<ProductVariantBuilder, ProductVariant> builder) The Master Variant of the Product.
- Parameters:
builder
- function to build the masterVariant value- Returns:
- Builder
-
masterVariant
The Master Variant of the Product.
- Parameters:
masterVariant
- value to be set- Returns:
- Builder
-
variants
Additional Product Variants.
- Parameters:
variants
- value to be set- Returns:
- Builder
-
variants
Additional Product Variants.
- Parameters:
variants
- value to be set- Returns:
- Builder
-
plusVariants
Additional Product Variants.
- Parameters:
variants
- value to be set- Returns:
- Builder
-
plusVariants
public ProductProjectionBuilder plusVariants(Function<ProductVariantBuilder, ProductVariantBuilder> builder) Additional Product Variants.
- Parameters:
builder
- function to build the variants value- Returns:
- Builder
-
withVariants
public ProductProjectionBuilder withVariants(Function<ProductVariantBuilder, ProductVariantBuilder> builder) Additional Product Variants.
- Parameters:
builder
- function to build the variants value- Returns:
- Builder
-
addVariants
Additional Product Variants.
- Parameters:
builder
- function to build the variants value- Returns:
- Builder
-
setVariants
Additional Product Variants.
- Parameters:
builder
- function to build the variants value- Returns:
- Builder
-
taxCategory
public ProductProjectionBuilder taxCategory(Function<TaxCategoryReferenceBuilder, TaxCategoryReferenceBuilder> builder) The TaxCategory of the Product.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
withTaxCategory
public ProductProjectionBuilder 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
public ProductProjectionBuilder state(Function<StateReferenceBuilder, StateReferenceBuilder> builder) 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 ProductProjectionBuilder reviewRatingStatistics(Function<ReviewRatingStatisticsBuilder, ReviewRatingStatisticsBuilder> builder) Review statistics of the Product.
- Parameters:
builder
- function to build the reviewRatingStatistics value- Returns:
- Builder
-
withReviewRatingStatistics
public ProductProjectionBuilder withReviewRatingStatistics(Function<ReviewRatingStatisticsBuilder, ReviewRatingStatistics> builder) Review statistics of the Product.
- Parameters:
builder
- function to build the reviewRatingStatistics value- Returns:
- Builder
-
reviewRatingStatistics
public ProductProjectionBuilder reviewRatingStatistics(@Nullable ReviewRatingStatistics reviewRatingStatistics) Review statistics of the Product.
- Parameters:
reviewRatingStatistics
- value to be set- Returns:
- Builder
-
priceMode
Indicates whether the Prices of the Product Projection are embedded or standalone. Projecting Prices only works with
Embedded
, there is currently no support forStandalone
.- Parameters:
priceMode
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Product.
- Returns:
- id
-
getVersion
Current version of the Product.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the ProductProjection was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the ProductProjection was last updated.
- Returns:
- lastModifiedAt
-
getKey
User-defined unique identifier of the Product.
- Returns:
- key
-
getProductType
The ProductType defining the Attributes of the Product.
- Returns:
- productType
-
getName
Name of the Product.
- Returns:
- name
-
getDescription
Description of the Product.
- Returns:
- description
-
getSlug
User-defined identifier used in a deep-link URL for the Product. Must be unique across a Project, but can be the same for Products in different locales. Matches the pattern
[a-zA-Z0-9_\-]{2,256}
. For good performance, indexes are provided for the first 15languages
set in the Project.- Returns:
- slug
-
getCategories
Categories assigned to the Product.
- Returns:
- categories
-
getCategoryOrderHints
Order of Product in Categories.
- Returns:
- categoryOrderHints
-
getMetaTitle
Title of the Product displayed in search results.
- Returns:
- metaTitle
-
getMetaDescription
Description of the Product displayed in search results below the meta title.
- Returns:
- metaDescription
-
getMetaKeywords
Keywords that give additional information about the Product to search engines.
- Returns:
- metaKeywords
-
getSearchKeywords
Used by Product Suggestions, but is also considered for a full text search.
- Returns:
- searchKeywords
-
getHasStagedChanges
true
if the staged data is different from the current data.- Returns:
- hasStagedChanges
-
getPublished
true
if the Product is published.- Returns:
- published
-
getMasterVariant
The Master Variant of the Product.
- Returns:
- masterVariant
-
getVariants
Additional Product Variants.
- Returns:
- variants
-
getTaxCategory
The TaxCategory of the Product.
- Returns:
- taxCategory
-
getState
State of the Product.
- Returns:
- state
-
getReviewRatingStatistics
Review statistics of the Product.
- Returns:
- reviewRatingStatistics
-
getPriceMode
Indicates whether the Prices of the Product Projection are embedded or standalone. Projecting Prices only works with
Embedded
, there is currently no support forStandalone
.- Returns:
- priceMode
-
build
builds ProductProjection with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductProjection>
- Returns:
- ProductProjection
-
buildUnchecked
builds ProductProjection without checking for non-null required values- Returns:
- ProductProjection
-
of
factory method for an instance of ProductProjectionBuilder- Returns:
- builder
-
of
create builder for ProductProjection instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-