Interface ProductProjection
- All Superinterfaces:
BaseResource
,DomainResource<ProductProjection>
,Identifiable<ProductProjection>
,MetaAttributes
,ProductDataLike
,ProductProjectionMixin
,Versioned<ProductProjection>
,WithKey
,WithLocalizedSlug
Example to create an instance using the builder pattern
ProductProjection productProjection = ProductProjection.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.productType(productTypeBuilder -> productTypeBuilder)
.name(nameBuilder -> nameBuilder)
.slug(slugBuilder -> slugBuilder)
.plusCategories(categoriesBuilder -> categoriesBuilder)
.masterVariant(masterVariantBuilder -> masterVariantBuilder)
.plusVariants(variantsBuilder -> variantsBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductProjectionBuilder
builder()
builder factory method for ProductProjectionstatic ProductProjectionBuilder
builder
(ProductProjection template) create builder for ProductProjection instancestatic ProductProjection
deepCopy
(ProductProjection template) factory method to create a deep copy of ProductProjection@NotNull @Valid List<CategoryReference>
Categories assigned to the Product.@Valid CategoryOrderHints
Order of Product in Categories.@NotNull ZonedDateTime
Date and time (UTC) the ProductProjection was initially created.@Valid LocalizedString
Description of the Product.true
if the staged data is different from the current data.@NotNull String
getId()
Unique identifier of the Product.getKey()
User-defined unique identifier of the Product.@NotNull ZonedDateTime
Date and time (UTC) the ProductProjection was last updated.@NotNull @Valid ProductVariant
The Master Variant of the Product.@Valid LocalizedString
Description of the Product displayed in search results below the meta title.@Valid LocalizedString
Keywords that give additional information about the Product to search engines.@Valid LocalizedString
Title of the Product displayed in search results.@NotNull @Valid LocalizedString
getName()
Name of the Product.Indicates whether the Prices of the Product Projection are embedded or standalone.@NotNull @Valid ProductTypeReference
The ProductType defining the Attributes of the Product.true
if the Product is published.@Valid ReviewRatingStatistics
Review statistics of the Product.@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 StateReference
getState()
State of the Product.@Valid TaxCategoryReference
The TaxCategory of the Product.@NotNull @Valid List<ProductVariant>
Additional Product Variants.@NotNull Long
Current version of the Product.static ProductProjection
of()
factory methodstatic ProductProjection
of
(ProductProjection template) factory method to create a shallow copy ProductProjectionvoid
setCategories
(CategoryReference... categories) Categories assigned to the Product.void
setCategories
(List<CategoryReference> categories) Categories assigned to the Product.void
setCategoryOrderHints
(CategoryOrderHints categoryOrderHints) Order of Product in Categories.void
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the ProductProjection was initially created.void
setDescription
(LocalizedString description) Description of the Product.void
setHasStagedChanges
(Boolean hasStagedChanges) true
if the staged data is different from the current data.void
Unique identifier of the Product.void
User-defined unique identifier of the Product.void
setLastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the ProductProjection was last updated.void
setMasterVariant
(ProductVariant masterVariant) The Master Variant of the Product.void
setMetaDescription
(LocalizedString metaDescription) Description of the Product displayed in search results below the meta title.void
setMetaKeywords
(LocalizedString metaKeywords) Keywords that give additional information about the Product to search engines.void
setMetaTitle
(LocalizedString metaTitle) Title of the Product displayed in search results.void
setName
(LocalizedString name) Name of the Product.void
setPriceMode
(ProductPriceModeEnum priceMode) Indicates whether the Prices of the Product Projection are embedded or standalone.void
setProductType
(ProductTypeReference productType) The ProductType defining the Attributes of the Product.void
setPublished
(Boolean published) true
if the Product is published.void
setReviewRatingStatistics
(ReviewRatingStatistics reviewRatingStatistics) Review statistics 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
setState
(StateReference state) State of the Product.void
setTaxCategory
(TaxCategoryReference taxCategory) The TaxCategory of the Product.void
setVariants
(ProductVariant... variants) Additional Product Variants.void
setVariants
(List<ProductVariant> variants) Additional Product Variants.void
setVersion
(Long version) Current version of the Product.static com.fasterxml.jackson.core.type.TypeReference<ProductProjection>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withProductProjection
(Function<ProductProjection, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResource
Methods inherited from interface com.commercetools.api.models.DomainResource
get
Methods inherited from interface com.commercetools.api.models.product.ProductDataLike
findVariantBySku, getAllVariants, getVariant, getVariantOrMaster
Methods inherited from interface com.commercetools.api.models.product.ProductProjectionMixin
findFirstMatchingVariant, findMatchingVariants, findVariant
-
Method Details
-
getId
Unique identifier of the Product.
- Specified by:
getId
in interfaceBaseResource
- Specified by:
getId
in interfaceDomainResource<ProductProjection>
- Specified by:
getId
in interfaceIdentifiable<ProductProjection>
- Specified by:
getId
in interfaceProductProjectionMixin
- Specified by:
getId
in interfaceVersioned<ProductProjection>
- Returns:
- id
-
getVersion
Current version of the Product.
- Specified by:
getVersion
in interfaceBaseResource
- Specified by:
getVersion
in interfaceDomainResource<ProductProjection>
- Specified by:
getVersion
in interfaceVersioned<ProductProjection>
- Returns:
- version
-
getKey
String getKey()User-defined unique identifier of the Product.
-
getCreatedAt
Date and time (UTC) the ProductProjection was initially created.
- Specified by:
getCreatedAt
in interfaceBaseResource
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the ProductProjection was last updated.
- Specified by:
getLastModifiedAt
in interfaceBaseResource
- Returns:
- lastModifiedAt
-
getProductType
The ProductType defining the Attributes of the Product.
- Returns:
- productType
-
getName
Name of the Product.
- Specified by:
getName
in interfaceProductDataLike
- Returns:
- name
-
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}
. For good performance, indexes are provided for the first 15languages
set in the Project.- Specified by:
getSlug
in interfaceProductDataLike
- Specified by:
getSlug
in interfaceWithLocalizedSlug
- Returns:
- slug
-
getCategories
Categories assigned to the Product.
- Specified by:
getCategories
in interfaceProductDataLike
- Returns:
- categories
-
getCategoryOrderHints
Order of Product in Categories.
- Specified by:
getCategoryOrderHints
in interfaceProductDataLike
- Returns:
- categoryOrderHints
-
getMetaTitle
Title of the Product displayed in search results.
- Specified by:
getMetaTitle
in interfaceMetaAttributes
- Specified by:
getMetaTitle
in interfaceProductDataLike
- Returns:
- metaTitle
-
getMetaDescription
Description of the Product displayed in search results below the meta title.
- 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
-
getSearchKeywords
Used by Product Suggestions, but is also considered for a full text search.
- Specified by:
getSearchKeywords
in interfaceProductDataLike
- Returns:
- searchKeywords
-
getHasStagedChanges
Boolean getHasStagedChanges()true
if the staged data is different from the current data.- Returns:
- hasStagedChanges
-
getPublished
Boolean getPublished()true
if the Product is published.- Returns:
- published
-
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:
-
getTaxCategory
The TaxCategory of the Product.
- Returns:
- taxCategory
-
getState
State of the Product.
- Returns:
- state
-
getReviewRatingStatistics
Review statistics of the Product.
- Returns:
- reviewRatingStatistics
-
getPriceMode
ProductPriceModeEnum getPriceMode()Indicates whether the Prices of the Product Projection are embedded or standalone. Projecting Prices only works with
Embedded
, there is currently no support forStandalone
.- Returns:
- priceMode
-
setId
Unique identifier of the Product.
- Specified by:
setId
in interfaceBaseResource
- Parameters:
id
- value to be set
-
setVersion
Current version of the Product.
- Specified by:
setVersion
in interfaceBaseResource
- Parameters:
version
- value to be set
-
setKey
User-defined unique identifier of the Product.
- Parameters:
key
- value to be set
-
setCreatedAt
Date and time (UTC) the ProductProjection was initially created.
- Specified by:
setCreatedAt
in interfaceBaseResource
- Parameters:
createdAt
- value to be set
-
setLastModifiedAt
Date and time (UTC) the ProductProjection was last updated.
- Specified by:
setLastModifiedAt
in interfaceBaseResource
- Parameters:
lastModifiedAt
- value to be set
-
setProductType
The ProductType defining the Attributes of the Product.
- Parameters:
productType
- value to be set
-
setName
Name of the Product.
- Parameters:
name
- 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}
. For good performance, indexes are provided for the first 15languages
set in the Project.- Parameters:
slug
- 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
Order of Product in Categories.
- Parameters:
categoryOrderHints
- value to be set
-
setMetaTitle
Title of the Product displayed in search results.
- Parameters:
metaTitle
- value to be set
-
setMetaDescription
Description of the Product displayed in search results below the meta title.
- Parameters:
metaDescription
- value to be set
-
setMetaKeywords
Keywords that give additional information about the Product to search engines.
- Parameters:
metaKeywords
- value to be set
-
setSearchKeywords
Used by Product Suggestions, but is also considered for a full text search.
- Parameters:
searchKeywords
- value to be set
-
setHasStagedChanges
true
if the staged data is different from the current data.- Parameters:
hasStagedChanges
- value to be set
-
setPublished
true
if the Product is published.- Parameters:
published
- 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
-
setTaxCategory
The TaxCategory of the Product.
- Parameters:
taxCategory
- value to be set
-
setState
State of the Product.
- Parameters:
state
- value to be set
-
setReviewRatingStatistics
Review statistics of the Product.
- Parameters:
reviewRatingStatistics
- value to be set
-
setPriceMode
Indicates whether the Prices of the Product Projection are embedded or standalone. Projecting Prices only works with
Embedded
, there is currently no support forStandalone
.- Parameters:
priceMode
- value to be set
-
of
factory method- Returns:
- instance of ProductProjection
-
of
factory method to create a shallow copy ProductProjection- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ProductProjection- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductProjection- Returns:
- builder
-
builder
create builder for ProductProjection instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductProjection
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
-