Class ProductDataBuilder
- All Implemented Interfaces:
Builder<ProductData>
Example to create an instance using the builder pattern
ProductData productData = ProductData.builder()
.name(nameBuilder -> nameBuilder)
.plusCategories(categoriesBuilder -> categoriesBuilder)
.slug(slugBuilder -> slugBuilder)
.masterVariant(masterVariantBuilder -> masterVariantBuilder)
.plusVariants(variantsBuilder -> variantsBuilder)
.searchKeywords(searchKeywordsBuilder -> searchKeywordsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCategories assigned to the Product.Additional Product Variants.build()
builds ProductData with checking for non-null required valuesbuilds ProductData 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) Numerical values to allow ordering of Products within a specified Category.Numerical values to allow ordering of Products within a specified Category.description
(LocalizedString description) Description of the Product.Description of the Product.Categories assigned to the Product.Numerical values to allow ordering of Products within a specified Category.Description of the Product.The Master Variant of the Product.Description of the Product as used by search engines.Keywords that give additional information about the Product to search engines.Title of the Product as used by search engines.getName()
Name 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.Additional Product Variants.masterVariant
(ProductVariant masterVariant) The Master Variant of the Product.The Master Variant of the Product.metaDescription
(LocalizedString metaDescription) Description of the Product as used by search engines.Description of the Product as used by search engines.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 as used by search engines.Title of the Product as used by search engines.name
(LocalizedString name) Name of the Product.Name of the Product.static ProductDataBuilder
of()
factory method for an instance of ProductDataBuilderstatic ProductDataBuilder
of
(ProductData template) create builder for ProductData instanceplusCategories
(CategoryReference... categories) Categories assigned to the Product.Categories assigned to the Product.plusVariants
(ProductVariant... variants) Additional Product Variants.Additional Product Variants.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.variants
(ProductVariant... variants) Additional Product Variants.variants
(List<ProductVariant> variants) Additional Product Variants.Categories assigned to the Product.Numerical values to allow ordering of Products within a specified Category.Description of the Product.The Master Variant of the Product.Description of the Product as used by search engines.Keywords that give additional information about the Product to search engines.Title of the Product as used by search engines.Name 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.Additional Product Variants.
-
Constructor Details
-
ProductDataBuilder
public ProductDataBuilder()
-
-
Method Details
-
name
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
-
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 ProductDataBuilder plusCategories(Function<CategoryReferenceBuilder, CategoryReferenceBuilder> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
withCategories
public ProductDataBuilder withCategories(Function<CategoryReferenceBuilder, CategoryReferenceBuilder> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
addCategories
public ProductDataBuilder addCategories(Function<CategoryReferenceBuilder, CategoryReference> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
setCategories
public ProductDataBuilder setCategories(Function<CategoryReferenceBuilder, CategoryReference> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
categoryOrderHints
public ProductDataBuilder categoryOrderHints(Function<CategoryOrderHintsBuilder, CategoryOrderHintsBuilder> builder) Numerical values to allow ordering of Products within a specified Category.
- Parameters:
builder
- function to build the categoryOrderHints value- Returns:
- Builder
-
withCategoryOrderHints
public ProductDataBuilder withCategoryOrderHints(Function<CategoryOrderHintsBuilder, CategoryOrderHints> builder) Numerical values to allow ordering of Products within a specified Category.
- Parameters:
builder
- function to build the categoryOrderHints value- Returns:
- Builder
-
categoryOrderHints
Numerical values to allow ordering of Products within a specified Category.
- Parameters:
categoryOrderHints
- value to be set- Returns:
- Builder
-
description
public ProductDataBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the Product.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
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
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}
.- 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}
.- 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}
.- Parameters:
slug
- value to be set- Returns:
- Builder
-
metaTitle
public ProductDataBuilder metaTitle(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Title of the Product as used by search engines.
- Parameters:
builder
- function to build the metaTitle value- Returns:
- Builder
-
withMetaTitle
Title of the Product as used by search engines.
- Parameters:
builder
- function to build the metaTitle value- Returns:
- Builder
-
metaTitle
Title of the Product as used by search engines.
- Parameters:
metaTitle
- value to be set- Returns:
- Builder
-
metaDescription
public ProductDataBuilder metaDescription(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the Product as used by search engines.
- Parameters:
builder
- function to build the metaDescription value- Returns:
- Builder
-
withMetaDescription
public ProductDataBuilder withMetaDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Description of the Product as used by search engines.
- Parameters:
builder
- function to build the metaDescription value- Returns:
- Builder
-
metaDescription
Description of the Product as used by search engines.
- Parameters:
metaDescription
- value to be set- Returns:
- Builder
-
metaKeywords
public ProductDataBuilder 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 ProductDataBuilder 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
-
masterVariant
public ProductDataBuilder masterVariant(Function<ProductVariantBuilder, ProductVariantBuilder> builder) The Master Variant of the Product.
- Parameters:
builder
- function to build the masterVariant value- Returns:
- Builder
-
withMasterVariant
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 ProductDataBuilder plusVariants(Function<ProductVariantBuilder, ProductVariantBuilder> builder) Additional Product Variants.
- Parameters:
builder
- function to build the variants value- Returns:
- Builder
-
withVariants
public ProductDataBuilder 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
-
searchKeywords
public ProductDataBuilder 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 ProductDataBuilder 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
-
getName
Name of the Product.
- Returns:
- name
-
getCategories
Categories assigned to the Product.
- Returns:
- categories
-
getCategoryOrderHints
Numerical values to allow ordering of Products within a specified Category.
- Returns:
- categoryOrderHints
-
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}
.- Returns:
- slug
-
getMetaTitle
Title of the Product as used by search engines.
- Returns:
- metaTitle
-
getMetaDescription
Description of the Product as used by search engines.
- Returns:
- metaDescription
-
getMetaKeywords
Keywords that give additional information about the Product to search engines.
- Returns:
- metaKeywords
-
getMasterVariant
The Master Variant of the Product.
- Returns:
- masterVariant
-
getVariants
Additional Product Variants.
- Returns:
- variants
-
getSearchKeywords
Used by Product Suggestions, but is also considered for a full text search.
- Returns:
- searchKeywords
-
build
builds ProductData with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductData>
- Returns:
- ProductData
-
buildUnchecked
builds ProductData without checking for non-null required values- Returns:
- ProductData
-
of
factory method for an instance of ProductDataBuilder- Returns:
- builder
-
of
create builder for ProductData instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-