Interface VariantDraft
- All Superinterfaces:
Draft<VariantDraft>
Draft for creating a new Variant. When a Variant is created, only the current version is set. The staged version is only set when the Variant is updated with different current and staged data.
Example to create an instance using the builder pattern
VariantDraft variantDraft = VariantDraft.builder()
.product(productBuilder -> productBuilder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic VariantDraftBuilderbuilder()builder factory method for VariantDraftstatic VariantDraftBuilderbuilder(VariantDraft template) create builder for VariantDraft instancecopyDeep()static VariantDraftdeepCopy(VariantDraft template) factory method to create a deep copy of VariantDraft@Valid List<AssetDraft>Media assets for the Variant.Variant Attributes according to the respective AttributeDefinition.Images for the Variant.getKey()User-defined unique identifier for the Variant.@NotNull @Valid ProductResourceIdentifierResourceIdentifier of the Product the Variant belongs to.Indicates whether the Variant is published.getSku()User-defined unique SKU of the Variant.static VariantDraftof()factory methodstatic VariantDraftof(VariantDraft template) factory method to create a shallow copy VariantDraftvoidsetAssets(AssetDraft... assets) Media assets for the Variant.voidsetAssets(List<AssetDraft> assets) Media assets for the Variant.voidsetAttributes(Attribute... attributes) Variant Attributes according to the respective AttributeDefinition.voidsetAttributes(List<Attribute> attributes) Variant Attributes according to the respective AttributeDefinition.voidImages for the Variant.voidImages for the Variant.voidUser-defined unique identifier for the Variant.voidsetProduct(ProductResourceIdentifier product) ResourceIdentifier of the Product the Variant belongs to.voidsetPublish(Boolean publish) Indicates whether the Variant is published.voidUser-defined unique SKU of the Variant.static tools.jackson.core.type.TypeReference<VariantDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithVariantDraft(Function<VariantDraft, T> helper) accessor map function
-
Method Details
-
getKey
String getKey()User-defined unique identifier for the Variant. This field is optional, but we strongly recommend setting it.
- Returns:
- key
-
getSku
String getSku()User-defined unique SKU of the Variant.
- Returns:
- sku
-
getProduct
ResourceIdentifier of the Product the Variant belongs to.
- Returns:
- product
-
getPublish
Boolean getPublish()Indicates whether the Variant is published. If
true, the Variant will be immediately available in the current published state.- Returns:
- publish
-
getImages
Images for the Variant.
- Returns:
- images
-
getAttributes
Variant Attributes according to the respective AttributeDefinition.
- Returns:
- attributes
-
getAssets
Media assets for the Variant.
- Returns:
- assets
-
setKey
User-defined unique identifier for the Variant. This field is optional, but we strongly recommend setting it.
- Parameters:
key- value to be set
-
setSku
User-defined unique SKU of the Variant.
- Parameters:
sku- value to be set
-
setProduct
ResourceIdentifier of the Product the Variant belongs to.
- Parameters:
product- value to be set
-
setPublish
Indicates whether the Variant is published. If
true, the Variant will be immediately available in the current published state.- Parameters:
publish- value to be set
-
setImages
Images for the Variant.
- Parameters:
images- values to be set
-
setImages
Images for the Variant.
- Parameters:
images- values to be set
-
setAttributes
Variant Attributes according to the respective AttributeDefinition.
- Parameters:
attributes- values to be set
-
setAttributes
Variant Attributes according to the respective AttributeDefinition.
- Parameters:
attributes- values to be set
-
setAssets
Media assets for the Variant.
- Parameters:
assets- values to be set
-
setAssets
Media assets for the Variant.
- Parameters:
assets- values to be set
-
of
factory method- Returns:
- instance of VariantDraft
-
of
factory method to create a shallow copy VariantDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
VariantDraft copyDeep() -
deepCopy
factory method to create a deep copy of VariantDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for VariantDraft- Returns:
- builder
-
builder
create builder for VariantDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withVariantDraft
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
-