Class ProductImportImpl
- All Implemented Interfaces:
ImportResource
,ProductImport
,io.vrap.rmf.base.client.ModelBase
The data representation for a Product to be imported that is persisted as a Product in the Project.
This is the minimal representation required for creating a Product in commercetools.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Maps toProduct.categories
.Maps toProduct.description
.getKey()
User-defined unique identifier.A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.getName()
Maps toProduct.name
.Determines the type of Prices the API uses.TheproductType
of a Product.Ifpublish
is set to eithertrue
orfalse
, both staged and current projections are set to the same value provided by the import data.Search keywords are primarily used by the suggester but are also considered for the full-text search.getSlug()
Human-readable identifiers usually used as deep-link URL to the related product.getState()
The Reference to the State with which the Product is associated.The Reference to the TaxCategory with which the Product is associated.int
hashCode()
void
setCategories
(CategoryKeyReference... categories) Maps toProduct.categories
.void
setCategories
(List<CategoryKeyReference> categories) Maps toProduct.categories
.void
setDescription
(LocalizedString description) Maps toProduct.description
.void
User-defined unique identifier.void
setMetaDescription
(LocalizedString metaDescription) A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.void
setMetaKeywords
(LocalizedString metaKeywords) A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.void
setMetaTitle
(LocalizedString metaTitle) A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.void
setName
(LocalizedString name) Maps toProduct.name
.void
setPriceMode
(ProductPriceModeEnum priceMode) Determines the type of Prices the API uses.void
setProductType
(ProductTypeKeyReference productType) TheproductType
of a Product.void
setPublish
(Boolean publish) Ifpublish
is set to eithertrue
orfalse
, both staged and current projections are set to the same value provided by the import data.void
setSearchKeywords
(SearchKeywords searchKeywords) Search keywords are primarily used by the suggester but are also considered for the full-text search.void
setSlug
(LocalizedString slug) Human-readable identifiers usually used as deep-link URL to the related product.void
setState
(StateKeyReference state) The Reference to the State with which the Product is associated.void
setTaxCategory
(TaxCategoryKeyReference taxCategory) The Reference to the TaxCategory with which the Product is associated.toString()
Methods inherited from interface com.commercetools.importapi.models.common.ImportResource
withImportResource
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
Methods inherited from interface com.commercetools.importapi.models.products.ProductImport
withProductImport
-
Constructor Details
-
ProductImportImpl
public ProductImportImpl()create empty instance
-
-
Method Details
-
getKey
User-defined unique identifier. If a Product with this
key
exists, it will be updated with the imported data.- Specified by:
getKey
in interfaceImportResource
- Specified by:
getKey
in interfaceProductImport
- Returns:
- key
-
getName
Maps to
Product.name
.- Specified by:
getName
in interfaceProductImport
- Returns:
- name
-
getProductType
The
productType
of a Product. Maps toProduct.productType
. The Reference to the ProductType with which the Product is associated. If referenced ProductType does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary ProductType is created.- Specified by:
getProductType
in interfaceProductImport
- Returns:
- productType
-
getSlug
Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a Project, but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.
- Specified by:
getSlug
in interfaceProductImport
- Returns:
- slug
-
getDescription
Maps to
Product.description
.- Specified by:
getDescription
in interfaceProductImport
- Returns:
- description
-
getCategories
Maps to
Product.categories
. The References to the Categories with which the Product is associated. If referenced Categories do not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Categories are created.- Specified by:
getCategories
in interfaceProductImport
- Returns:
- categories
-
getMetaTitle
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Specified by:
getMetaTitle
in interfaceProductImport
- Returns:
- metaTitle
-
getMetaDescription
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Specified by:
getMetaDescription
in interfaceProductImport
- Returns:
- metaDescription
-
getMetaKeywords
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Specified by:
getMetaKeywords
in interfaceProductImport
- Returns:
- metaKeywords
-
getTaxCategory
The Reference to the TaxCategory with which the Product is associated. If referenced TaxCategory does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary TaxCategory is created.- Specified by:
getTaxCategory
in interfaceProductImport
- Returns:
- taxCategory
-
getSearchKeywords
Search keywords are primarily used by the suggester but are also considered for the full-text search. SearchKeywords is a JSON object where the keys are of IETF language tag. The value to a language tag key is an array of SearchKeyword for the specific language.
{ "en": [ { "text": "Multi tool" }, { "text": "Swiss Army Knife", "suggestTokenizer": { "type": "whitespace" } } ], "de": [ { "text": "Schweizer Messer", "suggestTokenizer": { "type": "custom", "inputs": ["schweizer messer", "offiziersmesser", "sackmesser"] } } ] }
- Specified by:
getSearchKeywords
in interfaceProductImport
- Returns:
- searchKeywords
-
getState
The Reference to the State with which the Product is associated. If referenced State does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary State is created.- Specified by:
getState
in interfaceProductImport
- Returns:
- state
-
getPublish
If
publish
is set to eithertrue
orfalse
, both staged and current projections are set to the same value provided by the import data. Ifpublish
is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whetherpublish
is set or not.- Specified by:
getPublish
in interfaceProductImport
- Returns:
- publish
-
getPriceMode
Determines the type of Prices the API uses. See ProductPriceMode for more details. If not provided, the existing
Product.priceMode
is not changed.- Specified by:
getPriceMode
in interfaceProductImport
- Returns:
- priceMode
-
setKey
Description copied from interface:ProductImport
User-defined unique identifier. If a Product with this
key
exists, it will be updated with the imported data.- Specified by:
setKey
in interfaceImportResource
- Specified by:
setKey
in interfaceProductImport
- Parameters:
key
- value to be set
-
setName
Description copied from interface:ProductImport
Maps to
Product.name
.- Specified by:
setName
in interfaceProductImport
- Parameters:
name
- value to be set
-
setProductType
Description copied from interface:ProductImport
The
productType
of a Product. Maps toProduct.productType
. The Reference to the ProductType with which the Product is associated. If referenced ProductType does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary ProductType is created.- Specified by:
setProductType
in interfaceProductImport
- Parameters:
productType
- value to be set
-
setSlug
Description copied from interface:ProductImport
Human-readable identifiers usually used as deep-link URL to the related product. Each slug must be unique across a Project, but a product can have the same slug for different languages. Allowed are alphabetic, numeric, underscore (_) and hyphen (-) characters.
- Specified by:
setSlug
in interfaceProductImport
- Parameters:
slug
- value to be set
-
setDescription
Description copied from interface:ProductImport
Maps to
Product.description
.- Specified by:
setDescription
in interfaceProductImport
- Parameters:
description
- value to be set
-
setCategories
Description copied from interface:ProductImport
Maps to
Product.categories
. The References to the Categories with which the Product is associated. If referenced Categories do not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Categories are created.- Specified by:
setCategories
in interfaceProductImport
- Parameters:
categories
- values to be set
-
setCategories
Description copied from interface:ProductImport
Maps to
Product.categories
. The References to the Categories with which the Product is associated. If referenced Categories do not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Categories are created.- Specified by:
setCategories
in interfaceProductImport
- Parameters:
categories
- values to be set
-
setMetaTitle
Description copied from interface:ProductImport
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Specified by:
setMetaTitle
in interfaceProductImport
- Parameters:
metaTitle
- value to be set
-
setMetaDescription
Description copied from interface:ProductImport
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Specified by:
setMetaDescription
in interfaceProductImport
- Parameters:
metaDescription
- value to be set
-
setMetaKeywords
Description copied from interface:ProductImport
A localized string is a JSON object where the keys are of IETF language tag, and the values the corresponding strings used for that language.
{ "de": "Hundefutter", "en": "dog food" }
- Specified by:
setMetaKeywords
in interfaceProductImport
- Parameters:
metaKeywords
- value to be set
-
setTaxCategory
Description copied from interface:ProductImport
The Reference to the TaxCategory with which the Product is associated. If referenced TaxCategory does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary TaxCategory is created.- Specified by:
setTaxCategory
in interfaceProductImport
- Parameters:
taxCategory
- value to be set
-
setSearchKeywords
Description copied from interface:ProductImport
Search keywords are primarily used by the suggester but are also considered for the full-text search. SearchKeywords is a JSON object where the keys are of IETF language tag. The value to a language tag key is an array of SearchKeyword for the specific language.
{ "en": [ { "text": "Multi tool" }, { "text": "Swiss Army Knife", "suggestTokenizer": { "type": "whitespace" } } ], "de": [ { "text": "Schweizer Messer", "suggestTokenizer": { "type": "custom", "inputs": ["schweizer messer", "offiziersmesser", "sackmesser"] } } ] }
- Specified by:
setSearchKeywords
in interfaceProductImport
- Parameters:
searchKeywords
- value to be set
-
setState
Description copied from interface:ProductImport
The Reference to the State with which the Product is associated. If referenced State does not exist, the
state
of the ImportOperation will be set tounresolved
until the necessary State is created.- Specified by:
setState
in interfaceProductImport
- Parameters:
state
- value to be set
-
setPublish
Description copied from interface:ProductImport
If
publish
is set to eithertrue
orfalse
, both staged and current projections are set to the same value provided by the import data. Ifpublish
is not set, the staged projection is set to the provided import data, but the current projection stays unchanged. However, if the import data contains no update, that is, if it matches the staged projection of the existing Product, the import induces no change in the existing Product whetherpublish
is set or not.- Specified by:
setPublish
in interfaceProductImport
- Parameters:
publish
- value to be set
-
setPriceMode
Description copied from interface:ProductImport
Determines the type of Prices the API uses. See ProductPriceMode for more details. If not provided, the existing
Product.priceMode
is not changed.- Specified by:
setPriceMode
in interfaceProductImport
- Parameters:
priceMode
- value to be set
-
equals
-
hashCode
public int hashCode() -
toString
-