Interface ProductData
- All Superinterfaces:
MetaAttributes
,ProductDataLike
,WithLocalizedSlug
Contains all the data of a Product and its Product Variants.
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()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductDataBuilder
builder()
builder factory method for ProductDatastatic ProductDataBuilder
builder
(ProductData template) create builder for ProductData instancestatic ProductData
deepCopy
(ProductData template) factory method to create a deep copy of ProductData@NotNull @Valid List<CategoryReference>
Categories assigned to the Product.@Valid CategoryOrderHints
Numerical values to allow ordering of Products within a specified Category.@Valid LocalizedString
Description of the Product.@NotNull @Valid ProductVariant
The Master Variant of 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.@NotNull @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.@NotNull @Valid List<ProductVariant>
Additional Product Variants.static ProductData
of()
factory methodstatic ProductData
of
(ProductData template) factory method to create a shallow copy ProductDatavoid
setCategories
(CategoryReference... categories) Categories assigned to the Product.void
setCategories
(List<CategoryReference> 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
setMasterVariant
(ProductVariant masterVariant) The Master Variant of 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
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
setVariants
(ProductVariant... variants) Additional Product Variants.void
setVariants
(List<ProductVariant> variants) Additional Product Variants.static com.fasterxml.jackson.core.type.TypeReference<ProductData>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withProductData
(Function<ProductData, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.product.ProductDataLike
findVariantBySku, getAllVariants, getVariant, getVariantOrMaster
-
Method Details
-
getName
Name of the Product.
- Specified by:
getName
in interfaceProductDataLike
- Returns:
- name
-
getCategories
Categories assigned to the Product.
- Specified by:
getCategories
in interfaceProductDataLike
- Returns:
- categories
-
getCategoryOrderHints
Numerical values to allow ordering of Products within a specified Category.
- Specified by:
getCategoryOrderHints
in interfaceProductDataLike
- Returns:
- categoryOrderHints
-
getDescription
Description of the Product.
- Specified by:
getDescription
in interfaceProductDataLike
- 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}
.- Specified by:
getSlug
in interfaceProductDataLike
- Specified by:
getSlug
in interfaceWithLocalizedSlug
- Returns:
- slug
-
getMetaTitle
Title of the Product as used by search engines.
- Specified by:
getMetaTitle
in interfaceMetaAttributes
- Specified by:
getMetaTitle
in interfaceProductDataLike
- Returns:
- metaTitle
-
getMetaDescription
Description of the Product as used by search engines.
- Specified by:
getMetaDescription
in interfaceMetaAttributes
- Specified by:
getMetaDescription
in interfaceProductDataLike
- Returns:
- metaDescription
-
getMetaKeywords
Keywords that give additional information about the Product to search engines.
- Specified by:
getMetaKeywords
in interfaceMetaAttributes
- Specified by:
getMetaKeywords
in interfaceProductDataLike
- Returns:
- metaKeywords
-
getMasterVariant
The Master Variant of the Product.
- Specified by:
getMasterVariant
in interfaceProductDataLike
- Returns:
- masterVariant
- See Also:
-
getVariants
Additional Product Variants.
- Specified by:
getVariants
in interfaceProductDataLike
- Returns:
- variants
- See Also:
-
getSearchKeywords
Used by Product Suggestions, but is also considered for a full text search.
- Specified by:
getSearchKeywords
in interfaceProductDataLike
- Returns:
- searchKeywords
-
setName
Name of the Product.
- Parameters:
name
- 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
-
setDescription
Description of the Product.
- Parameters:
description
- value to be set
-
setSlug
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
-
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 Master Variant of the Product.
- Parameters:
masterVariant
- value to be set
-
setVariants
Additional Product Variants.
- Parameters:
variants
- values to be set
-
setVariants
Additional Product Variants.
- Parameters:
variants
- values to be set
-
setSearchKeywords
Used by Product Suggestions, but is also considered for a full text search.
- Parameters:
searchKeywords
- value to be set
-
of
factory method- Returns:
- instance of ProductData
-
of
factory method to create a shallow copy ProductData- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ProductData- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductData- Returns:
- builder
-
builder
create builder for ProductData instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductData
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
-