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)
.plusAttributes(attributesBuilder -> attributesBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductProjectionBuilderbuilder()builder factory method for ProductProjectionstatic ProductProjectionBuilderbuilder(ProductProjection template) create builder for ProductProjection instancecopyDeep()static ProductProjectiondeepCopy(ProductProjection template) factory method to create a deep copy of ProductProjectionAttributes according to the respective AttributeDefinition.@NotNull @Valid List<CategoryReference>Categories assigned to the Product.@Valid CategoryOrderHintsOrder of Product in Categories.@NotNull ZonedDateTimeDate and time (UTC) the ProductProjection was initially created.@Valid LocalizedStringDescription of the Product.trueif the staged data is different from the current data.@NotNull StringgetId()Unique identifier of the Product.getKey()User-defined unique identifier of the Product.@NotNull ZonedDateTimeDate and time (UTC) the ProductProjection was last updated.@NotNull @Valid ProductVariantThe Master Variant of the Product.@Valid LocalizedStringDescription of the Product displayed in search results below the meta title.@Valid LocalizedStringKeywords that give additional information about the Product to search engines.@Valid LocalizedStringTitle of the Product displayed in search results.@NotNull @Valid LocalizedStringgetName()Name of the Product.Indicates whether the Prices of the Product Projection are embedded or standalone.@NotNull @Valid ProductTypeReferenceThe ProductType defining the Attributes of the Product.@Valid ReviewRatingStatisticsReview statistics of the Product.@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 StateReferencegetState()@Valid TaxCategoryReferenceThe TaxCategory of the Product.@NotNull @Valid List<ProductVariant>Additional Product Variants.@NotNull LongCurrent version of the Product.static ProductProjectionof()factory methodstatic ProductProjectionof(ProductProjection template) factory method to create a shallow copy ProductProjectionvoidsetAttributes(Attribute... attributes) Attributes according to the respective AttributeDefinition.voidsetAttributes(List<Attribute> attributes) 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) Order of Product in Categories.voidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the ProductProjection was initially created.voidsetDescription(LocalizedString description) Description of the Product.voidsetHasStagedChanges(Boolean hasStagedChanges) trueif the staged data is different from the current data.voidUnique identifier of the Product.voidUser-defined unique identifier of the Product.voidsetLastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the ProductProjection was last updated.voidsetMasterVariant(ProductVariant masterVariant) The Master Variant of the Product.voidsetMetaDescription(LocalizedString metaDescription) Description of the Product displayed in search results below the meta title.voidsetMetaKeywords(LocalizedString metaKeywords) Keywords that give additional information about the Product to search engines.voidsetMetaTitle(LocalizedString metaTitle) Title of the Product displayed in search results.voidsetName(LocalizedString name) Name of the Product.voidsetPriceMode(ProductPriceModeEnum priceMode) Indicates whether the Prices of the Product Projection are embedded or standalone.voidsetProductType(ProductTypeReference productType) The ProductType defining the Attributes of the Product.voidsetPublished(Boolean published) voidsetReviewRatingStatistics(ReviewRatingStatistics reviewRatingStatistics) Review statistics 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.voidsetState(StateReference state) voidsetTaxCategory(TaxCategoryReference taxCategory) The TaxCategory of the Product.voidsetVariants(ProductVariant... variants) Additional Product Variants.voidsetVariants(List<ProductVariant> variants) Additional Product Variants.voidsetVersion(Long version) Current version of the Product.static com.fasterxml.jackson.core.type.TypeReference<ProductProjection>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithProductProjection(Function<ProductProjection, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseResource
withBaseResourceMethods inherited from interface com.commercetools.api.models.DomainResource
getMethods inherited from interface com.commercetools.api.models.product.ProductDataLike
findVariantBySku, getAllVariants, getVariant, getVariantOrMasterMethods inherited from interface com.commercetools.api.models.product.ProductProjectionMixin
findFirstMatchingVariant, findMatchingVariants, findVariant
-
Method Details
-
getId
Unique identifier of the Product.
- Specified by:
getIdin interfaceBaseResource- Specified by:
getIdin interfaceDomainResource<ProductProjection>- Specified by:
getIdin interfaceIdentifiable<ProductProjection>- Specified by:
getIdin interfaceProductProjectionMixin- Specified by:
getIdin interfaceVersioned<ProductProjection>- Returns:
- id
-
getVersion
Current version of the Product.
- Specified by:
getVersionin interfaceBaseResource- Specified by:
getVersionin interfaceDomainResource<ProductProjection>- Specified by:
getVersionin 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:
getCreatedAtin interfaceBaseResource- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the ProductProjection was last updated.
- Specified by:
getLastModifiedAtin interfaceBaseResource- Returns:
- lastModifiedAt
-
getProductType
The ProductType defining the Attributes of the Product.
- Returns:
- productType
-
getName
Name of the Product.
- Specified by:
getNamein interfaceProductDataLike- Returns:
- name
-
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}. For good performance, indexes are provided for the first 15languagesset in the Project.- Specified by:
getSlugin interfaceProductDataLike- Specified by:
getSlugin interfaceWithLocalizedSlug- Returns:
- slug
-
getCategories
Categories assigned to the Product.
- Specified by:
getCategoriesin interfaceProductDataLike- Returns:
- categories
-
getCategoryOrderHints
Order of Product in Categories.
- Specified by:
getCategoryOrderHintsin interfaceProductDataLike- Returns:
- categoryOrderHints
-
getMetaTitle
Title of the Product displayed in search results.
- Specified by:
getMetaTitlein interfaceMetaAttributes- Specified by:
getMetaTitlein interfaceProductDataLike- Returns:
- metaTitle
-
getMetaDescription
Description of the Product displayed in search results below the meta title.
- 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
-
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
-
getHasStagedChanges
Boolean getHasStagedChanges()trueif the staged data is different from the current data.- Returns:
- hasStagedChanges
-
getPublished
Boolean getPublished()- Returns:
- published
-
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:
-
getTaxCategory
The TaxCategory of the Product.
- Returns:
- taxCategory
-
getState
- 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
-
getAttributes
Attributes according to the respective AttributeDefinition.
- Specified by:
getAttributesin interfaceProductDataLike- Returns:
- attributes
-
setId
Unique identifier of the Product.
- Specified by:
setIdin interfaceBaseResource- Parameters:
id- value to be set
-
setVersion
Current version of the Product.
- Specified by:
setVersionin 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:
setCreatedAtin interfaceBaseResource- Parameters:
createdAt- value to be set
-
setLastModifiedAt
Date and time (UTC) the ProductProjection was last updated.
- Specified by:
setLastModifiedAtin 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 15languagesset 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 Search Term Suggestions, but is also considered for a full text search in the Product Projection Search API.
- Parameters:
searchKeywords- value to be set
-
setHasStagedChanges
trueif the staged data is different from the current data.- Parameters:
hasStagedChanges- value to be set
-
setPublished
- 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
- 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
-
setAttributes
Attributes according to the respective AttributeDefinition.
- Parameters:
attributes- values to be set
-
setAttributes
Attributes according to the respective AttributeDefinition.
- Parameters:
attributes- values 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
-
copyDeep
ProductProjection copyDeep()- Specified by:
copyDeepin interfaceBaseResource
-
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
-