Class VariantDraftBuilder
- All Implemented Interfaces:
Builder<VariantDraft>
Example to create an instance using the builder pattern
VariantDraft variantDraft = VariantDraft.builder()
.product(productBuilder -> productBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAssets(Function<AssetDraftBuilder, AssetDraft> builder) Media assets for the Variant.addAttributes(Function<AttributeBuilder, Attribute> builder) Variant Attributes according to the respective AttributeDefinition.addImages(Function<ImageBuilder, Image> builder) Images for the Variant.assets(AssetDraft... assets) Media assets for the Variant.assets(List<AssetDraft> assets) Media assets for the Variant.attributes(Attribute... attributes) Variant Attributes according to the respective AttributeDefinition.attributes(List<Attribute> attributes) Variant Attributes according to the respective AttributeDefinition.build()builds VariantDraft with checking for non-null required valuesbuilds VariantDraft without checking for non-null required valuesMedia assets for the Variant.Variant Attributes according to the respective AttributeDefinition.Images for the Variant.getKey()User-defined unique identifier for the Variant.ResourceIdentifier of the Product the Variant belongs to.Indicates whether the Variant is published.getSku()User-defined unique SKU of the Variant.Images for the Variant.Images for the Variant.User-defined unique identifier for the Variant.static VariantDraftBuilderof()factory method for an instance of VariantDraftBuilderstatic VariantDraftBuilderof(VariantDraft template) create builder for VariantDraft instanceplusAssets(AssetDraft... assets) Media assets for the Variant.plusAssets(Function<AssetDraftBuilder, AssetDraftBuilder> builder) Media assets for the Variant.plusAttributes(Attribute... attributes) Variant Attributes according to the respective AttributeDefinition.Variant Attributes according to the respective AttributeDefinition.plusImages(Image... images) Images for the Variant.plusImages(Function<ImageBuilder, ImageBuilder> builder) Images for the Variant.product(ProductResourceIdentifier product) ResourceIdentifier of the Product the Variant belongs to.ResourceIdentifier of the Product the Variant belongs to.Indicates whether the Variant is published.setAssets(Function<AssetDraftBuilder, AssetDraft> builder) Media assets for the Variant.setAttributes(Function<AttributeBuilder, Attribute> builder) Variant Attributes according to the respective AttributeDefinition.setImages(Function<ImageBuilder, Image> builder) Images for the Variant.User-defined unique SKU of the Variant.withAssets(Function<AssetDraftBuilder, AssetDraftBuilder> builder) Media assets for the Variant.Variant Attributes according to the respective AttributeDefinition.withImages(Function<ImageBuilder, ImageBuilder> builder) Images for the Variant.ResourceIdentifier of the Product the Variant belongs to.
-
Constructor Details
-
VariantDraftBuilder
public VariantDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier for the Variant. This field is optional, but we strongly recommend setting it.
- Parameters:
key- value to be set- Returns:
- Builder
-
sku
User-defined unique SKU of the Variant.
- Parameters:
sku- value to be set- Returns:
- Builder
-
product
public VariantDraftBuilder product(Function<ProductResourceIdentifierBuilder, ProductResourceIdentifierBuilder> builder) ResourceIdentifier of the Product the Variant belongs to.
- Parameters:
builder- function to build the product value- Returns:
- Builder
-
withProduct
public VariantDraftBuilder withProduct(Function<ProductResourceIdentifierBuilder, ProductResourceIdentifier> builder) ResourceIdentifier of the Product the Variant belongs to.
- Parameters:
builder- function to build the product value- Returns:
- Builder
-
product
ResourceIdentifier of the Product the Variant belongs to.
- Parameters:
product- value to be set- Returns:
- Builder
-
publish
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- Returns:
- Builder
-
images
Images for the Variant.
- Parameters:
images- value to be set- Returns:
- Builder
-
images
Images for the Variant.
- Parameters:
images- value to be set- Returns:
- Builder
-
plusImages
Images for the Variant.
- Parameters:
images- value to be set- Returns:
- Builder
-
plusImages
Images for the Variant.
- Parameters:
builder- function to build the images value- Returns:
- Builder
-
withImages
Images for the Variant.
- Parameters:
builder- function to build the images value- Returns:
- Builder
-
addImages
Images for the Variant.
- Parameters:
builder- function to build the images value- Returns:
- Builder
-
setImages
Images for the Variant.
- Parameters:
builder- function to build the images value- Returns:
- Builder
-
attributes
Variant Attributes according to the respective AttributeDefinition.
- Parameters:
attributes- value to be set- Returns:
- Builder
-
attributes
Variant Attributes according to the respective AttributeDefinition.
- Parameters:
attributes- value to be set- Returns:
- Builder
-
plusAttributes
Variant Attributes according to the respective AttributeDefinition.
- Parameters:
attributes- value to be set- Returns:
- Builder
-
plusAttributes
Variant Attributes according to the respective AttributeDefinition.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
withAttributes
Variant Attributes according to the respective AttributeDefinition.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
addAttributes
Variant Attributes according to the respective AttributeDefinition.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
setAttributes
Variant Attributes according to the respective AttributeDefinition.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
assets
Media assets for the Variant.
- Parameters:
assets- value to be set- Returns:
- Builder
-
assets
Media assets for the Variant.
- Parameters:
assets- value to be set- Returns:
- Builder
-
plusAssets
Media assets for the Variant.
- Parameters:
assets- value to be set- Returns:
- Builder
-
plusAssets
Media assets for the Variant.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
withAssets
Media assets for the Variant.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
addAssets
Media assets for the Variant.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
setAssets
Media assets for the Variant.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
getKey
User-defined unique identifier for the Variant. This field is optional, but we strongly recommend setting it.
- Returns:
- key
-
getSku
User-defined unique SKU of the Variant.
- Returns:
- sku
-
getProduct
ResourceIdentifier of the Product the Variant belongs to.
- Returns:
- product
-
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
-
build
builds VariantDraft with checking for non-null required values- Specified by:
buildin interfaceBuilder<VariantDraft>- Returns:
- VariantDraft
-
buildUnchecked
builds VariantDraft without checking for non-null required values- Returns:
- VariantDraft
-
of
factory method for an instance of VariantDraftBuilder- Returns:
- builder
-
of
create builder for VariantDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-