Interface ProductVariantImport
- All Superinterfaces:
ImportResource
- All Known Implementing Classes:
ProductVariantImportImpl
The data representation for a ProductVariant to be imported that is persisted as a ProductVariant in the Project.
Example to create an instance using the builder pattern
ProductVariantImport productVariantImport = ProductVariantImport.builder()
.key("{key}")
.isMasterVariant(true)
.product(productBuilder -> productBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProductVariantImportBuilder
builder()
builder factory method for ProductVariantImportstatic ProductVariantImportBuilder
builder
(ProductVariantImport template) create builder for ProductVariantImport instancestatic ProductVariantImport
deepCopy
(ProductVariantImport template) factory method to create a deep copy of ProductVariantImportMaps toProductVariant.assets
.Maps toProductVariant.attributes
.Maps toProductVariant.images
.@NotNull Boolean
Maps toProductVariant.isMasterVariant
.@NotNull @Valid ProductKeyReference
The Product to which this Product Variant belongs.Ifpublish
is set to eithertrue
orfalse
, both staged and current projections are set to the same value provided by the import data.getSku()
Maps toProductVariant.sku
.static ProductVariantImport
of()
factory methodstatic ProductVariantImport
of
(ProductVariantImport template) factory method to create a shallow copy ProductVariantImportvoid
Maps toProductVariant.assets
.void
Maps toProductVariant.assets
.void
setAttributes
(Attribute... attributes) Maps toProductVariant.attributes
.void
setAttributes
(List<Attribute> attributes) Maps toProductVariant.attributes
.void
Maps toProductVariant.images
.void
Maps toProductVariant.images
.void
setIsMasterVariant
(Boolean isMasterVariant) Maps toProductVariant.isMasterVariant
.void
setProduct
(ProductKeyReference product) The Product to which this Product Variant belongs.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
Maps toProductVariant.sku
.static com.fasterxml.jackson.core.type.TypeReference<ProductVariantImport>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withProductVariantImport
(Function<ProductVariantImport, T> helper) accessor map functionMethods inherited from interface com.commercetools.importapi.models.common.ImportResource
getKey, setKey, withImportResource
-
Method Details
-
getSku
Maps to
ProductVariant.sku
.- Returns:
- sku
-
getIsMasterVariant
Maps to
ProductVariant.isMasterVariant
.- Returns:
- isMasterVariant
-
getAttributes
Maps to
ProductVariant.attributes
. The referenced attribute must be defined in an already existing ProductType in the project, or thestate
of the ImportOperation will beunresolved
.- Returns:
- attributes
-
getImages
Maps to
ProductVariant.images
.- Returns:
- images
-
getAssets
Maps to
ProductVariant.assets
.- Returns:
- assets
-
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.- Returns:
- publish
-
getProduct
The Product to which this Product Variant belongs. Maps to
ProductVariant.product
. The Reference to the Product with which the ProductVariant is associated. If referenced Product does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Product is created.- Returns:
- product
-
setSku
Maps to
ProductVariant.sku
.- Parameters:
sku
- value to be set
-
setIsMasterVariant
Maps to
ProductVariant.isMasterVariant
.- Parameters:
isMasterVariant
- value to be set
-
setAttributes
Maps to
ProductVariant.attributes
. The referenced attribute must be defined in an already existing ProductType in the project, or thestate
of the ImportOperation will beunresolved
.- Parameters:
attributes
- values to be set
-
setAttributes
Maps to
ProductVariant.attributes
. The referenced attribute must be defined in an already existing ProductType in the project, or thestate
of the ImportOperation will beunresolved
.- Parameters:
attributes
- values to be set
-
setImages
Maps to
ProductVariant.images
.- Parameters:
images
- values to be set
-
setImages
Maps to
ProductVariant.images
.- Parameters:
images
- values to be set
-
setAssets
Maps to
ProductVariant.assets
.- Parameters:
assets
- values to be set
-
setAssets
Maps to
ProductVariant.assets
.- Parameters:
assets
- values to be set
-
setPublish
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.- Parameters:
publish
- value to be set
-
setProduct
The Product to which this Product Variant belongs. Maps to
ProductVariant.product
. The Reference to the Product with which the ProductVariant is associated. If referenced Product does not exist, thestate
of the ImportOperation will be set tounresolved
until the necessary Product is created.- Parameters:
product
- value to be set
-
of
factory method- Returns:
- instance of ProductVariantImport
-
of
factory method to create a shallow copy ProductVariantImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ProductVariantImport- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ProductVariantImport- Returns:
- builder
-
builder
create builder for ProductVariantImport instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withProductVariantImport
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
-