Interface ProductImport
- All Superinterfaces:
ImportResource
Represents the data used to import a Product. Once imported, this data is persisted as a Product in the Project.
This is the minimal representation required for creating a Product in Composable Commerce.
Example to create an instance using the builder pattern
ProductImport productImport = ProductImport.builder()
.key("{key}")
.name(nameBuilder -> nameBuilder)
.productType(productTypeBuilder -> productTypeBuilder)
.slug(slugBuilder -> slugBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductImportBuilder
builder()
builder factory method for ProductImportstatic ProductImportBuilder
builder
(ProductImport template) create builder for ProductImport instancecopyDeep()
static ProductImport
deepCopy
(ProductImport template) factory method to create a deep copy of ProductImport@Valid List<CategoryKeyReference>
Maps toProductData.categories
.@Valid LocalizedString
Maps toProductData.description
.@NotNull String
getKey()
User-defined unique identifier.@Valid LocalizedString
Maps toProductData.metaDescription
.@Valid LocalizedString
Maps toProductData.metaKeywords
.@Valid LocalizedString
Maps toProductData.metaTitle
.@NotNull @Valid LocalizedString
getName()
Maps toProductData.name
.Maps toProduct.priceMode
.@NotNull @Valid ProductTypeKeyReference
Maps toProduct.productType
.Determines the published status and current/staged projection of the Product.@Valid SearchKeywords
Maps toProductData.searchKeywords
.@NotNull @Valid LocalizedString
getSlug()
Maps toProductData.slug
.@Valid StateKeyReference
getState()
Maps toProduct.state
.@Valid TaxCategoryKeyReference
Maps toProduct.taxCategory
.static ProductImport
of()
factory methodstatic ProductImport
of
(ProductImport template) factory method to create a shallow copy ProductImportvoid
setAttributes
(Attribute... attributes) set attributesvoid
setAttributes
(List<Attribute> attributes) set attributesvoid
setCategories
(CategoryKeyReference... categories) Maps toProductData.categories
.void
setCategories
(List<CategoryKeyReference> categories) Maps toProductData.categories
.void
setDescription
(LocalizedString description) Maps toProductData.description
.void
User-defined unique identifier.void
setMetaDescription
(LocalizedString metaDescription) Maps toProductData.metaDescription
.void
setMetaKeywords
(LocalizedString metaKeywords) Maps toProductData.metaKeywords
.void
setMetaTitle
(LocalizedString metaTitle) Maps toProductData.metaTitle
.void
setName
(LocalizedString name) Maps toProductData.name
.void
setPriceMode
(ProductPriceModeEnum priceMode) Maps toProduct.priceMode
.void
setProductType
(ProductTypeKeyReference productType) Maps toProduct.productType
.void
setPublish
(Boolean publish) Determines the published status and current/staged projection of the Product.void
setSearchKeywords
(SearchKeywords searchKeywords) Maps toProductData.searchKeywords
.void
setSlug
(LocalizedString slug) Maps toProductData.slug
.void
setState
(StateKeyReference state) Maps toProduct.state
.void
setTaxCategory
(TaxCategoryKeyReference taxCategory) Maps toProduct.taxCategory
.static com.fasterxml.jackson.core.type.TypeReference<ProductImport>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withProductImport
(Function<ProductImport, T> helper) accessor map functionMethods inherited from interface com.commercetools.importapi.models.common.ImportResource
withImportResource
-
Method Details
-
getKey
User-defined unique identifier. If a Product with this
key
exists, it is updated with the imported data.- Specified by:
getKey
in interfaceImportResource
- Returns:
- key
-
getName
Maps to
ProductData.name
.- Returns:
- name
-
getProductType
Maps to
Product.productType
. If the referenced ProductType does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced ProductType is created.- Returns:
- productType
-
getSlug
Maps to
ProductData.slug
.- Returns:
- slug
-
getDescription
Maps to
ProductData.description
.- Returns:
- description
-
getCategories
Maps to
ProductData.categories
. If the referenced Categories do not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Categories are created.- Returns:
- categories
-
getAttributes
- Returns:
- attributes
-
getMetaTitle
Maps to
ProductData.metaTitle
.- Returns:
- metaTitle
-
getMetaDescription
Maps to
ProductData.metaDescription
.- Returns:
- metaDescription
-
getMetaKeywords
Maps to
ProductData.metaKeywords
.- Returns:
- metaKeywords
-
getTaxCategory
Maps to
Product.taxCategory
. If the referenced TaxCategory does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced TaxCategory is created.- Returns:
- taxCategory
-
getSearchKeywords
Maps to
ProductData.searchKeywords
.- Returns:
- searchKeywords
-
getState
Maps to
Product.state
. If the referenced State does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced State is created.- Returns:
- state
-
getPublish
Boolean getPublish()Determines the published status and current/staged projection of the Product. For more information, see Managing the published state of Products.
- Returns:
- publish
-
getPriceMode
ProductPriceModeEnum getPriceMode()Maps to
Product.priceMode
.- Returns:
- priceMode
-
setKey
User-defined unique identifier. If a Product with this
key
exists, it is updated with the imported data.- Specified by:
setKey
in interfaceImportResource
- Parameters:
key
- value to be set
-
setName
Maps to
ProductData.name
.- Parameters:
name
- value to be set
-
setProductType
Maps to
Product.productType
. If the referenced ProductType does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced ProductType is created.- Parameters:
productType
- value to be set
-
setSlug
Maps to
ProductData.slug
.- Parameters:
slug
- value to be set
-
setDescription
Maps to
ProductData.description
.- Parameters:
description
- value to be set
-
setCategories
Maps to
ProductData.categories
. If the referenced Categories do not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Categories are created.- Parameters:
categories
- values to be set
-
setCategories
Maps to
ProductData.categories
. If the referenced Categories do not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced Categories are created.- Parameters:
categories
- values to be set
-
setAttributes
set attributes- Parameters:
attributes
- values to be set
-
setAttributes
set attributes- Parameters:
attributes
- values to be set
-
setMetaTitle
Maps to
ProductData.metaTitle
.- Parameters:
metaTitle
- value to be set
-
setMetaDescription
Maps to
ProductData.metaDescription
.- Parameters:
metaDescription
- value to be set
-
setMetaKeywords
Maps to
ProductData.metaKeywords
.- Parameters:
metaKeywords
- value to be set
-
setTaxCategory
Maps to
Product.taxCategory
. If the referenced TaxCategory does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced TaxCategory is created.- Parameters:
taxCategory
- value to be set
-
setSearchKeywords
Maps to
ProductData.searchKeywords
.- Parameters:
searchKeywords
- value to be set
-
setState
Maps to
Product.state
. If the referenced State does not exist, thestate
of the ImportOperation will be set tounresolved
until the referenced State is created.- Parameters:
state
- value to be set
-
setPublish
Determines the published status and current/staged projection of the Product. For more information, see Managing the published state of Products.
- Parameters:
publish
- value to be set
-
setPriceMode
Maps to
Product.priceMode
.- Parameters:
priceMode
- value to be set
-
of
factory method- Returns:
- instance of ProductImport
-
of
factory method to create a shallow copy ProductImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
copyDeep
ProductImport copyDeep()- Specified by:
copyDeep
in interfaceImportResource
-
deepCopy
factory method to create a deep copy of ProductImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductImport- Returns:
- builder
-
builder
create builder for ProductImport instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductImport
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
-