Interface ProductDraft
- All Superinterfaces:
Draft<ProductDraft>,WithKey
Example to create an instance using the builder pattern
ProductDraft productDraft = ProductDraft.builder()
.productType(productTypeBuilder -> productTypeBuilder)
.name(nameBuilder -> nameBuilder)
.slug(slugBuilder -> slugBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductDraftBuilderbuilder()builder factory method for ProductDraftstatic ProductDraftBuilderbuilder(ProductDraft template) create builder for ProductDraft instancecopyDeep()static ProductDraftdeepCopy(ProductDraft template) factory method to create a deep copy of ProductDraftProduct Attributes according to the respective AttributeDefinition.@Valid List<CategoryResourceIdentifier>Categories assigned to the Product.@Valid CategoryOrderHintsNumerical values to allow ordering of Products within specified Categories.@Valid LocalizedStringDescription of the Product.getKey()User-defined unique identifier for the Product.@Valid ProductVariantDraftThe Product Variant to be the Master Variant for the Product.@Valid LocalizedStringDescription of the Product as used by search engines.@Valid LocalizedStringKeywords that give additional information about the Product to search engines.@Valid LocalizedStringTitle of the Product as used by search engines.@NotNull @Valid LocalizedStringgetName()Name of the Product.Specifies the type of prices used when looking up a price for the Product.@NotNull @Valid ProductTypeResourceIdentifierThe Product Type defining the Attributes for the Product.Iftrue, the Product is published immediately to the current projection.@Valid SearchKeywordsUsed by Search Term Suggestions, but is also considered for a full text search in the Product Projection Search API.@NotNull @Valid LocalizedStringgetSlug()User-defined identifier used in a deep-link URL for the Product.@Valid StateResourceIdentifiergetState()State to be assigned to the Product.The Tax Category to be assigned to the Product.@Valid List<ProductVariantDraft>The additional Product Variants for the Product.static ProductDraftof()factory methodstatic ProductDraftof(ProductDraft template) factory method to create a shallow copy ProductDraftvoidsetAttributes(Attribute... attributes) Product Attributes according to the respective AttributeDefinition.voidsetAttributes(List<Attribute> attributes) Product Attributes according to the respective AttributeDefinition.voidsetCategories(CategoryResourceIdentifier... categories) Categories assigned to the Product.voidsetCategories(List<CategoryResourceIdentifier> categories) Categories assigned to the Product.voidsetCategoryOrderHints(CategoryOrderHints categoryOrderHints) Numerical values to allow ordering of Products within specified Categories.voidsetDescription(LocalizedString description) Description of the Product.voidUser-defined unique identifier for the Product.voidsetMasterVariant(ProductVariantDraft masterVariant) The Product Variant to be the Master Variant for the Product.voidsetMetaDescription(LocalizedString metaDescription) Description of the Product as used by search engines.voidsetMetaKeywords(LocalizedString metaKeywords) Keywords that give additional information about the Product to search engines.voidsetMetaTitle(LocalizedString metaTitle) Title of the Product as used by search engines.voidsetName(LocalizedString name) Name of the Product.voidsetPriceMode(ProductPriceModeEnum priceMode) Specifies the type of prices used when looking up a price for the Product.voidsetProductType(ProductTypeResourceIdentifier productType) The Product Type defining the Attributes for the Product.voidsetPublish(Boolean publish) Iftrue, the Product is published immediately to the current projection.voidsetSearchKeywords(SearchKeywords searchKeywords) Used by Search Term Suggestions, but is also considered for a full text search in the Product Projection Search API.voidsetSlug(LocalizedString slug) User-defined identifier used in a deep-link URL for the Product.voidsetState(StateResourceIdentifier state) State to be assigned to the Product.voidsetTaxCategory(TaxCategoryResourceIdentifier taxCategory) The Tax Category to be assigned to the Product.voidsetVariants(ProductVariantDraft... variants) The additional Product Variants for the Product.voidsetVariants(List<ProductVariantDraft> variants) The additional Product Variants for the Product.static com.fasterxml.jackson.core.type.TypeReference<ProductDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithProductDraft(Function<ProductDraft, T> helper) accessor map function
-
Method Details
-
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
String 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
keymust match the pattern^[A-Za-z0-9_-]{2,256}$. -
getDescription
Description of the Product.
- Returns:
- description
-
getCategories
Categories assigned to the Product.
- Returns:
- categories
-
getCategoryOrderHints
Numerical values to allow ordering of Products within specified Categories. If the referenced Categories are not also assigned in the
categoriesfield, an InvalidOperation error is returned.- 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
variantsare 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 Search Term Suggestions, but is also considered for a full text search in the Product Projection Search API.
- Returns:
- searchKeywords
-
getState
State to be assigned to the Product.
- Returns:
- state
-
getPublish
Boolean getPublish()If
true, the Product is published immediately to the current projection.- Returns:
- publish
-
getPriceMode
ProductPriceModeEnum getPriceMode()Specifies the type of prices used when looking up a price for the Product.
- Returns:
- priceMode
-
getAttributes
Product Attributes according to the respective AttributeDefinition. Not supported by Product Projection Search.
- Returns:
- attributes
-
setProductType
The Product Type defining the Attributes for the Product. Cannot be changed later.
- Parameters:
productType- value to be set
-
setName
Name of the Product.
- Parameters:
name- value to be set
-
setSlug
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
-
setKey
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
keymust match the pattern^[A-Za-z0-9_-]{2,256}$.- Parameters:
key- value to be set
-
setDescription
Description of the Product.
- Parameters:
description- value to be set
-
setCategories
Categories assigned to the Product.
- Parameters:
categories- values to be set
-
setCategories
Categories assigned to the Product.
- Parameters:
categories- values to be set
-
setCategoryOrderHints
Numerical values to allow ordering of Products within specified Categories. If the referenced Categories are not also assigned in the
categoriesfield, an InvalidOperation error is returned.- Parameters:
categoryOrderHints- value to be set
-
setMetaTitle
Title of the Product as used by search engines.
- Parameters:
metaTitle- value to be set
-
setMetaDescription
Description of the Product as used by search engines.
- Parameters:
metaDescription- value to be set
-
setMetaKeywords
Keywords that give additional information about the Product to search engines.
- Parameters:
metaKeywords- value to be set
-
setMasterVariant
The Product Variant to be the Master Variant for the Product. Required if
variantsare provided also.- Parameters:
masterVariant- value to be set
-
setVariants
The additional Product Variants for the Product.
- Parameters:
variants- values to be set
-
setVariants
The additional Product Variants for the Product.
- Parameters:
variants- values to be set
-
setTaxCategory
The Tax Category to be assigned to the Product.
- Parameters:
taxCategory- value to be set
-
setSearchKeywords
Used by Search Term Suggestions, but is also considered for a full text search in the Product Projection Search API.
- Parameters:
searchKeywords- value to be set
-
setState
State to be assigned to the Product.
- Parameters:
state- value to be set
-
setPublish
If
true, the Product is published immediately to the current projection.- Parameters:
publish- value to be set
-
setPriceMode
Specifies the type of prices used when looking up a price for the Product.
- Parameters:
priceMode- value to be set
-
setAttributes
Product Attributes according to the respective AttributeDefinition. Not supported by Product Projection Search.
- Parameters:
attributes- values to be set
-
setAttributes
Product Attributes according to the respective AttributeDefinition. Not supported by Product Projection Search.
- Parameters:
attributes- values to be set
-
of
factory method- Returns:
- instance of ProductDraft
-
of
factory method to create a shallow copy ProductDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
ProductDraft copyDeep() -
deepCopy
factory method to create a deep copy of ProductDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductDraft- Returns:
- builder
-
builder
create builder for ProductDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withProductDraft
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-