Class ProductDraftBuilder
- All Implemented Interfaces:
Builder<ProductDraft>
Example to create an instance using the builder pattern
ProductDraft productDraft = ProductDraft.builder()
.productType(productTypeBuilder -> productTypeBuilder)
.name(nameBuilder -> nameBuilder)
.slug(slugBuilder -> slugBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCategories assigned to the Product.The additional Product Variants for the Product.build()
builds ProductDraft with checking for non-null required valuesbuilds ProductDraft without checking for non-null required valuescategories
(CategoryResourceIdentifier... categories) Categories assigned to the Product.categories
(List<CategoryResourceIdentifier> 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.getKey()
User-defined unique identifier for the Product.The Product Variant to be the Master Variant for 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.Specifies the type of prices used when looking up a price for the Product.The Product Type defining the Attributes for the Product.Iftrue
, the Product is published immediately to the current projection.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 to be assigned to the Product.The Tax Category to be assigned to the Product.The additional Product Variants for the Product.User-defined unique identifier for the Product.masterVariant
(ProductVariantDraft masterVariant) The Product Variant to be the Master Variant for the Product.The Product Variant to be the Master Variant for 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 ProductDraftBuilder
of()
factory method for an instance of ProductDraftBuilderstatic ProductDraftBuilder
of
(ProductDraft template) create builder for ProductDraft instanceplusCategories
(CategoryResourceIdentifier... categories) Categories assigned to the Product.plusCategories
(Function<CategoryResourceIdentifierBuilder, CategoryResourceIdentifierBuilder> builder) Categories assigned to the Product.plusVariants
(ProductVariantDraft... variants) The additional Product Variants for the Product.The additional Product Variants for the Product.priceMode
(ProductPriceModeEnum priceMode) Specifies the type of prices used when looking up a price for the Product.productType
(ProductTypeResourceIdentifier productType) The Product Type defining the Attributes for the Product.productType
(Function<ProductTypeResourceIdentifierBuilder, ProductTypeResourceIdentifierBuilder> builder) The Product Type defining the Attributes for the Product.Iftrue
, the Product is published immediately to the current projection.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.The additional Product Variants for the Product.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
(StateResourceIdentifier state) State to be assigned to the Product.State to be assigned to the Product.taxCategory
(TaxCategoryResourceIdentifier taxCategory) The Tax Category to be assigned to the Product.taxCategory
(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifierBuilder> builder) The Tax Category to be assigned to the Product.variants
(ProductVariantDraft... variants) The additional Product Variants for the Product.variants
(List<ProductVariantDraft> variants) The additional Product Variants for the Product.withCategories
(Function<CategoryResourceIdentifierBuilder, CategoryResourceIdentifierBuilder> builder) Categories assigned to the Product.Numerical values to allow ordering of Products within a specified Category.Description of the Product.The Product Variant to be the Master Variant for 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.withProductType
(Function<ProductTypeResourceIdentifierBuilder, ProductTypeResourceIdentifier> builder) The Product Type defining the Attributes for 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.State to be assigned to the Product.withTaxCategory
(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifier> builder) The Tax Category to be assigned to the Product.The additional Product Variants for the Product.
-
Constructor Details
-
ProductDraftBuilder
public ProductDraftBuilder()
-
-
Method Details
-
productType
public ProductDraftBuilder productType(Function<ProductTypeResourceIdentifierBuilder, ProductTypeResourceIdentifierBuilder> builder) The Product Type defining the Attributes for the Product. Cannot be changed later.
- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
withProductType
public ProductDraftBuilder withProductType(Function<ProductTypeResourceIdentifierBuilder, ProductTypeResourceIdentifier> builder) The Product Type defining the Attributes for the Product. Cannot be changed later.
- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
productType
The Product Type defining the Attributes for the Product. Cannot be changed later.
- Parameters:
productType
- value to be set- Returns:
- Builder
-
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
-
slug
User-defined identifier used in a deep-link URL for the Product. It must be unique across a Project, but a Product can have the same slug in different Locales. It must match 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. It must be unique across a Project, but a Product can have the same slug in different Locales. It must match 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. It must be unique across a Project, but a Product can have the same slug in different Locales. It must match the pattern
[a-zA-Z0-9_\\-]{2,256}
.- Parameters:
slug
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier for the Product.
This field is optional for backwards compatibility reasons, but we strongly recommend setting it. Keys are mandatory for importing Products with the Import API and the Merchant Center.
To update a Product using the Import API or Merchant Center, the Product
key
must match the pattern^[A-Za-z0-9_-]{2,256}$
.- Parameters:
key
- value to be set- Returns:
- Builder
-
description
public ProductDraftBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the Product.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
public ProductDraftBuilder 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
-
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 ProductDraftBuilder plusCategories(Function<CategoryResourceIdentifierBuilder, CategoryResourceIdentifierBuilder> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
withCategories
public ProductDraftBuilder withCategories(Function<CategoryResourceIdentifierBuilder, CategoryResourceIdentifierBuilder> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
addCategories
public ProductDraftBuilder addCategories(Function<CategoryResourceIdentifierBuilder, CategoryResourceIdentifier> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
setCategories
public ProductDraftBuilder setCategories(Function<CategoryResourceIdentifierBuilder, CategoryResourceIdentifier> builder) Categories assigned to the Product.
- Parameters:
builder
- function to build the categories value- Returns:
- Builder
-
categoryOrderHints
public ProductDraftBuilder 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 ProductDraftBuilder 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
-
metaTitle
public ProductDraftBuilder 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 ProductDraftBuilder 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 ProductDraftBuilder 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 ProductDraftBuilder 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 ProductDraftBuilder 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 ProductDraftBuilder masterVariant(Function<ProductVariantDraftBuilder, ProductVariantDraftBuilder> builder) The Product Variant to be the Master Variant for the Product. Required if
variants
are provided also.- Parameters:
builder
- function to build the masterVariant value- Returns:
- Builder
-
withMasterVariant
public ProductDraftBuilder withMasterVariant(Function<ProductVariantDraftBuilder, ProductVariantDraft> builder) The Product Variant to be the Master Variant for the Product. Required if
variants
are provided also.- Parameters:
builder
- function to build the masterVariant value- Returns:
- Builder
-
masterVariant
The Product Variant to be the Master Variant for the Product. Required if
variants
are provided also.- Parameters:
masterVariant
- value to be set- Returns:
- Builder
-
variants
The additional Product Variants for the Product.
- Parameters:
variants
- value to be set- Returns:
- Builder
-
variants
The additional Product Variants for the Product.
- Parameters:
variants
- value to be set- Returns:
- Builder
-
plusVariants
The additional Product Variants for the Product.
- Parameters:
variants
- value to be set- Returns:
- Builder
-
plusVariants
public ProductDraftBuilder plusVariants(Function<ProductVariantDraftBuilder, ProductVariantDraftBuilder> builder) The additional Product Variants for the Product.
- Parameters:
builder
- function to build the variants value- Returns:
- Builder
-
withVariants
public ProductDraftBuilder withVariants(Function<ProductVariantDraftBuilder, ProductVariantDraftBuilder> builder) The additional Product Variants for the Product.
- Parameters:
builder
- function to build the variants value- Returns:
- Builder
-
addVariants
public ProductDraftBuilder addVariants(Function<ProductVariantDraftBuilder, ProductVariantDraft> builder) The additional Product Variants for the Product.
- Parameters:
builder
- function to build the variants value- Returns:
- Builder
-
setVariants
public ProductDraftBuilder setVariants(Function<ProductVariantDraftBuilder, ProductVariantDraft> builder) The additional Product Variants for the Product.
- Parameters:
builder
- function to build the variants value- Returns:
- Builder
-
taxCategory
public ProductDraftBuilder taxCategory(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifierBuilder> builder) The Tax Category to be assigned to the Product.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
withTaxCategory
public ProductDraftBuilder withTaxCategory(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifier> builder) The Tax Category to be assigned to the Product.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
taxCategory
The Tax Category to be assigned to the Product.
- Parameters:
taxCategory
- value to be set- Returns:
- Builder
-
searchKeywords
public ProductDraftBuilder 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 ProductDraftBuilder 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
-
state
public ProductDraftBuilder state(Function<StateResourceIdentifierBuilder, StateResourceIdentifierBuilder> builder) State to be assigned to the Product.
- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
withState
public ProductDraftBuilder withState(Function<StateResourceIdentifierBuilder, StateResourceIdentifier> builder) State to be assigned to the Product.
- Parameters:
builder
- function to build the state value- Returns:
- Builder
-
state
State to be assigned to the Product.
- Parameters:
state
- value to be set- Returns:
- Builder
-
publish
If
true
, the Product is published immediately to the current projection.- Parameters:
publish
- value to be set- Returns:
- Builder
-
priceMode
Specifies the type of prices used when looking up a price for the Product.
- Parameters:
priceMode
- value to be set- Returns:
- Builder
-
getProductType
The Product Type defining the Attributes for the Product. Cannot be changed later.
- Returns:
- productType
-
getName
Name of the Product.
- Returns:
- name
-
getSlug
User-defined identifier used in a deep-link URL for the Product. It must be unique across a Project, but a Product can have the same slug in different Locales. It must match the pattern
[a-zA-Z0-9_\\-]{2,256}
.- Returns:
- slug
-
getKey
User-defined unique identifier for the Product.
This field is optional for backwards compatibility reasons, but we strongly recommend setting it. Keys are mandatory for importing Products with the Import API and the Merchant Center.
To update a Product using the Import API or Merchant Center, the Product
key
must match the pattern^[A-Za-z0-9_-]{2,256}$
.- Returns:
- key
-
getDescription
Description of the Product.
- Returns:
- description
-
getCategories
Categories assigned to the Product.
- Returns:
- categories
-
getCategoryOrderHints
Numerical values to allow ordering of Products within a specified Category.
- Returns:
- categoryOrderHints
-
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 Product Variant to be the Master Variant for the Product. Required if
variants
are provided also.- Returns:
- masterVariant
-
getVariants
The additional Product Variants for the Product.
- Returns:
- variants
-
getTaxCategory
The Tax Category to be assigned to the Product.
- Returns:
- taxCategory
-
getSearchKeywords
Used by Product Suggestions, but is also considered for a full text search.
- Returns:
- searchKeywords
-
getState
State to be assigned to the Product.
- Returns:
- state
-
getPublish
If
true
, the Product is published immediately to the current projection.- Returns:
- publish
-
getPriceMode
Specifies the type of prices used when looking up a price for the Product.
- Returns:
- priceMode
-
build
builds ProductDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductDraft>
- Returns:
- ProductDraft
-
buildUnchecked
builds ProductDraft without checking for non-null required values- Returns:
- ProductDraft
-
of
factory method for an instance of ProductDraftBuilder- Returns:
- builder
-
of
create builder for ProductDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-