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)
.plusAttributes(attributesBuilder -> attributesBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductDataBuilderbuilder()builder factory method for ProductDatastatic ProductDataBuilderbuilder(ProductData template) create builder for ProductData instancecopyDeep()static ProductDatadeepCopy(ProductData template) factory method to create a deep copy of ProductDataProduct Attributes according to the respective AttributeDefinition.@NotNull @Valid List<CategoryReference>Categories assigned to the Product.@Valid CategoryOrderHintsNumerical values to allow ordering of Products within a specified Category.@Valid LocalizedStringDescription of the Product.@NotNull @Valid ProductVariantThe Master Variant of 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.@NotNull @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.@NotNull @Valid List<ProductVariant>Additional Product Variants.static ProductDataof()factory methodstatic ProductDataof(ProductData template) factory method to create a shallow copy ProductDatavoidsetAttributes(Attribute... attributes) Product Attributes according to the respective AttributeDefinition.voidsetAttributes(List<Attribute> attributes) Product Attributes according to the respective AttributeDefinition.voidsetCategories(CategoryReference... categories) Categories assigned to the Product.voidsetCategories(List<CategoryReference> categories) Categories assigned to the Product.voidsetCategoryOrderHints(CategoryOrderHints categoryOrderHints) Numerical values to allow ordering of Products within a specified Category.voidsetDescription(LocalizedString description) Description of the Product.voidsetMasterVariant(ProductVariant masterVariant) The Master Variant of 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.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.voidsetVariants(ProductVariant... variants) Additional Product Variants.voidsetVariants(List<ProductVariant> variants) Additional Product Variants.static com.fasterxml.jackson.core.type.TypeReference<ProductData>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithProductData(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:
getNamein interfaceProductDataLike- Returns:
- name
-
getCategories
Categories assigned to the Product.
- Specified by:
getCategoriesin interfaceProductDataLike- Returns:
- categories
-
getCategoryOrderHints
Numerical values to allow ordering of Products within a specified Category.
- Specified by:
getCategoryOrderHintsin interfaceProductDataLike- Returns:
- categoryOrderHints
-
getDescription
Description of the Product.
- Specified by:
getDescriptionin 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:
getSlugin interfaceProductDataLike- Specified by:
getSlugin interfaceWithLocalizedSlug- Returns:
- slug
-
getMetaTitle
Title of the Product as used by search engines.
- Specified by:
getMetaTitlein interfaceMetaAttributes- Specified by:
getMetaTitlein interfaceProductDataLike- Returns:
- metaTitle
-
getMetaDescription
Description of the Product as used by search engines.
- Specified by:
getMetaDescriptionin interfaceMetaAttributes- Specified by:
getMetaDescriptionin interfaceProductDataLike- Returns:
- metaDescription
-
getMetaKeywords
Keywords that give additional information about the Product to search engines.
- Specified by:
getMetaKeywordsin interfaceMetaAttributes- Specified by:
getMetaKeywordsin interfaceProductDataLike- Returns:
- metaKeywords
-
getMasterVariant
The Master Variant of the Product.
- Specified by:
getMasterVariantin interfaceProductDataLike- Returns:
- masterVariant
- See Also:
-
getVariants
Additional Product Variants.
- Specified by:
getVariantsin interfaceProductDataLike- Returns:
- variants
- See Also:
-
getSearchKeywords
Used by Search Term Suggestions, but is also considered for a full text search in the Product Projection Search API.
- Specified by:
getSearchKeywordsin interfaceProductDataLike- Returns:
- searchKeywords
-
getAttributes
Product Attributes according to the respective AttributeDefinition. Not supported by Product Projection Search.
- Specified by:
getAttributesin interfaceProductDataLike- Returns:
- attributes
-
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 Search Term Suggestions, but is also considered for a full text search in the Product Projection Search API.
- Parameters:
searchKeywords- 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 ProductData
-
of
factory method to create a shallow copy ProductData- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
ProductData copyDeep() -
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
-