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 ProductDraftBuilder
builder()
builder factory method for ProductDraftstatic ProductDraftBuilder
builder
(ProductDraft template) create builder for ProductDraft instancestatic ProductDraft
deepCopy
(ProductDraft template) factory method to create a deep copy of ProductDraft@Valid List<CategoryResourceIdentifier>
Categories assigned to the Product.@Valid CategoryOrderHints
Numerical values to allow ordering of Products within a specified Category.@Valid LocalizedString
Description of the Product.getKey()
User-defined unique identifier for the Product.@Valid ProductVariantDraft
The Product Variant to be the Master Variant for the Product.@Valid LocalizedString
Description of the Product as used by search engines.@Valid LocalizedString
Keywords that give additional information about the Product to search engines.@Valid LocalizedString
Title of the Product as used by search engines.@NotNull @Valid LocalizedString
getName()
Name of the Product.Specifies the type of prices used when looking up a price for the Product.@NotNull @Valid ProductTypeResourceIdentifier
The Product Type defining the Attributes for the Product.Iftrue
, the Product is published immediately to the current projection.@Valid SearchKeywords
Used by Product Suggestions, but is also considered for a full text search.@NotNull @Valid LocalizedString
getSlug()
User-defined identifier used in a deep-link URL for the Product.@Valid StateResourceIdentifier
getState()
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 ProductDraft
of()
factory methodstatic ProductDraft
of
(ProductDraft template) factory method to create a shallow copy ProductDraftvoid
setCategories
(CategoryResourceIdentifier... categories) Categories assigned to the Product.void
setCategories
(List<CategoryResourceIdentifier> categories) Categories assigned to the Product.void
setCategoryOrderHints
(CategoryOrderHints categoryOrderHints) Numerical values to allow ordering of Products within a specified Category.void
setDescription
(LocalizedString description) Description of the Product.void
User-defined unique identifier for the Product.void
setMasterVariant
(ProductVariantDraft masterVariant) The Product Variant to be the Master Variant for the Product.void
setMetaDescription
(LocalizedString metaDescription) Description of the Product as used by search engines.void
setMetaKeywords
(LocalizedString metaKeywords) Keywords that give additional information about the Product to search engines.void
setMetaTitle
(LocalizedString metaTitle) Title of the Product as used by search engines.void
setName
(LocalizedString name) Name of the Product.void
setPriceMode
(ProductPriceModeEnum priceMode) Specifies the type of prices used when looking up a price for the Product.void
setProductType
(ProductTypeResourceIdentifier productType) The Product Type defining the Attributes for the Product.void
setPublish
(Boolean publish) Iftrue
, the Product is published immediately to the current projection.void
setSearchKeywords
(SearchKeywords searchKeywords) Used by Product Suggestions, but is also considered for a full text search.void
setSlug
(LocalizedString slug) User-defined identifier used in a deep-link URL for the Product.void
setState
(StateResourceIdentifier state) State to be assigned to the Product.void
setTaxCategory
(TaxCategoryResourceIdentifier taxCategory) The Tax Category to be assigned to the Product.void
setVariants
(ProductVariantDraft... variants) The additional Product Variants for the Product.void
setVariants
(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> T
withProductDraft
(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
key
must 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 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
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
-
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
key
must 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 a specified Category.
- 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
variants
are 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 Product Suggestions, but is also considered for a full text search.
- 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
-
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
-
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
-