Class VariantProjectionBuilder
- All Implemented Interfaces:
Builder<VariantProjection>
Example to create an instance using the builder pattern
VariantProjection variantProjection = VariantProjection.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.staged(true)
.variantId(0.3)
.product(productBuilder -> productBuilder)
.name(nameBuilder -> nameBuilder)
.slug(slugBuilder -> slugBuilder)
.plusImages(imagesBuilder -> imagesBuilder)
.plusAssets(assetsBuilder -> assetsBuilder)
.plusAttributes(attributesBuilder -> attributesBuilder)
.default(true)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAssets(Function<AssetBuilder, Asset> builder) Assets of the Variant.addAttributes(Function<AttributeBuilder, Attribute> builder) Attributes of the Variant, including product-level Attributes merged at projection time.addImages(Function<ImageBuilder, Image> builder) Images of the Variant.Assets of the Variant.Assets of the Variant.attributes(Attribute... attributes) Attributes of the Variant, including product-level Attributes merged at projection time.attributes(List<Attribute> attributes) Attributes of the Variant, including product-level Attributes merged at projection time.build()builds VariantProjection with checking for non-null required valuesbuilds VariantProjection without checking for non-null required valuescreatedAt(ZonedDateTime createdAt) Date and time (UTC) the Variant Projection was initially created.description(LocalizedString description) Description of the parent Product.Description of the parent Product.Assets of the Variant.Attributes of the Variant, including product-level Attributes merged at projection time.Date and time (UTC) the Variant Projection was initially created.Description of the parent Product.getId()Unique identifier of the Variant within its parent Product.Images of the Variant.getKey()User-defined unique identifier of the Variant.getName()Name of the parent Product.getPrice()The selected price based on the price selection query parameters.getSku()SKU of the Variant.getSlug()Slug of the parent Product.truefor the staged (draft) projection,falsefor the current (published) projection.Theidof the Variant.Current version of the Variant Projection.Unique identifier of the Variant within its parent Product.Images of the Variant.Images of the Variant.User-defined unique identifier of the Variant.name(LocalizedString name) Name of the parent Product.Name of the parent Product.static VariantProjectionBuilderof()factory method for an instance of VariantProjectionBuilderstatic VariantProjectionBuilderof(VariantProjection template) create builder for VariantProjection instanceplusAssets(Asset... assets) Assets of the Variant.plusAssets(Function<AssetBuilder, AssetBuilder> builder) Assets of the Variant.plusAttributes(Attribute... attributes) Attributes of the Variant, including product-level Attributes merged at projection time.Attributes of the Variant, including product-level Attributes merged at projection time.plusImages(Image... images) Images of the Variant.plusImages(Function<ImageBuilder, ImageBuilder> builder) Images of the Variant.The selected price based on the price selection query parameters.price(Function<PriceBuilder, PriceBuilder> builder) The selected price based on the price selection query parameters.product(ProductReference product) setAssets(Function<AssetBuilder, Asset> builder) Assets of the Variant.setAttributes(Function<AttributeBuilder, Attribute> builder) Attributes of the Variant, including product-level Attributes merged at projection time.setImages(Function<ImageBuilder, Image> builder) Images of the Variant.SKU of the Variant.slug(LocalizedString slug) Slug of the parent Product.Slug of the parent Product.truefor the staged (draft) projection,falsefor the current (published) projection.Theidof the Variant.Current version of the Variant Projection.withAssets(Function<AssetBuilder, AssetBuilder> builder) Assets of the Variant.Attributes of the Variant, including product-level Attributes merged at projection time.Description of the parent Product.withImages(Function<ImageBuilder, ImageBuilder> builder) Images of the Variant.Name of the parent Product.withPrice(Function<PriceBuilder, Price> builder) The selected price based on the price selection query parameters.Slug of the parent Product.
-
Constructor Details
-
VariantProjectionBuilder
public VariantProjectionBuilder()
-
-
Method Details
-
id
Unique identifier of the Variant within its parent Product.
- Parameters:
id- value to be set- Returns:
- Builder
-
version
Current version of the Variant Projection.
- Parameters:
version- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Variant Projection was initially created.
- Parameters:
createdAt- value to be set- Returns:
- Builder
-
staged
truefor the staged (draft) projection,falsefor the current (published) projection.- Parameters:
staged- value to be set- Returns:
- Builder
-
variantId
The
idof the Variant.- Parameters:
variantId- value to be set- Returns:
- Builder
-
product
public VariantProjectionBuilder product(Function<ProductReferenceBuilder, ProductReferenceBuilder> builder) - Parameters:
builder- function to build the product value- Returns:
- Builder
-
withProduct
public VariantProjectionBuilder withProduct(Function<ProductReferenceBuilder, ProductReference> builder) - Parameters:
builder- function to build the product value- Returns:
- Builder
-
product
- Parameters:
product- value to be set- Returns:
- Builder
-
name
public VariantProjectionBuilder name(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Name of the parent Product.
- Parameters:
builder- function to build the name value- Returns:
- Builder
-
withName
Name of the parent Product.
- Parameters:
builder- function to build the name value- Returns:
- Builder
-
name
Name of the parent Product.
- Parameters:
name- value to be set- Returns:
- Builder
-
slug
public VariantProjectionBuilder slug(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Slug of the parent Product.
- Parameters:
builder- function to build the slug value- Returns:
- Builder
-
withSlug
Slug of the parent Product.
- Parameters:
builder- function to build the slug value- Returns:
- Builder
-
slug
Slug of the parent Product.
- Parameters:
slug- value to be set- Returns:
- Builder
-
description
public VariantProjectionBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the parent Product.
- Parameters:
builder- function to build the description value- Returns:
- Builder
-
withDescription
public VariantProjectionBuilder withDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Description of the parent Product.
- Parameters:
builder- function to build the description value- Returns:
- Builder
-
description
Description of the parent Product.
- Parameters:
description- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Variant.
- Parameters:
key- value to be set- Returns:
- Builder
-
sku
SKU of the Variant.
- Parameters:
sku- value to be set- Returns:
- Builder
-
images
Images of the Variant.
- Parameters:
images- value to be set- Returns:
- Builder
-
images
Images of the Variant.
- Parameters:
images- value to be set- Returns:
- Builder
-
plusImages
Images of the Variant.
- Parameters:
images- value to be set- Returns:
- Builder
-
plusImages
Images of the Variant.
- Parameters:
builder- function to build the images value- Returns:
- Builder
-
withImages
Images of the Variant.
- Parameters:
builder- function to build the images value- Returns:
- Builder
-
addImages
Images of the Variant.
- Parameters:
builder- function to build the images value- Returns:
- Builder
-
setImages
Images of the Variant.
- Parameters:
builder- function to build the images value- Returns:
- Builder
-
assets
Assets of the Variant.
- Parameters:
assets- value to be set- Returns:
- Builder
-
assets
Assets of the Variant.
- Parameters:
assets- value to be set- Returns:
- Builder
-
plusAssets
Assets of the Variant.
- Parameters:
assets- value to be set- Returns:
- Builder
-
plusAssets
Assets of the Variant.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
withAssets
Assets of the Variant.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
addAssets
Assets of the Variant.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
setAssets
Assets of the Variant.
- Parameters:
builder- function to build the assets value- Returns:
- Builder
-
attributes
Attributes of the Variant, including product-level Attributes merged at projection time.
- Parameters:
attributes- value to be set- Returns:
- Builder
-
attributes
Attributes of the Variant, including product-level Attributes merged at projection time.
- Parameters:
attributes- value to be set- Returns:
- Builder
-
plusAttributes
Attributes of the Variant, including product-level Attributes merged at projection time.
- Parameters:
attributes- value to be set- Returns:
- Builder
-
plusAttributes
Attributes of the Variant, including product-level Attributes merged at projection time.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
withAttributes
Attributes of the Variant, including product-level Attributes merged at projection time.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
addAttributes
Attributes of the Variant, including product-level Attributes merged at projection time.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
setAttributes
Attributes of the Variant, including product-level Attributes merged at projection time.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
price
The selected price based on the price selection query parameters. Only present when price selection parameters are provided.
- Parameters:
builder- function to build the price value- Returns:
- Builder
-
withPrice
The selected price based on the price selection query parameters. Only present when price selection parameters are provided.
- Parameters:
builder- function to build the price value- Returns:
- Builder
-
price
The selected price based on the price selection query parameters. Only present when price selection parameters are provided.
- Parameters:
price- value to be set- Returns:
- Builder
-
_default
trueif this Variant is the default Variant of its Product (see Product.defaultVariant).falseotherwise.- Parameters:
_default- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Variant within its parent Product.
- Returns:
- id
-
getVersion
Current version of the Variant Projection.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Variant Projection was initially created.
- Returns:
- createdAt
-
getStaged
truefor the staged (draft) projection,falsefor the current (published) projection.- Returns:
- staged
-
getVariantId
The
idof the Variant.- Returns:
- variantId
-
getProduct
- Returns:
- product
-
getName
Name of the parent Product.
- Returns:
- name
-
getSlug
Slug of the parent Product.
- Returns:
- slug
-
getDescription
Description of the parent Product.
- Returns:
- description
-
getKey
User-defined unique identifier of the Variant.
- Returns:
- key
-
getSku
SKU of the Variant.
- Returns:
- sku
-
getImages
Images of the Variant.
- Returns:
- images
-
getAssets
Assets of the Variant.
- Returns:
- assets
-
getAttributes
Attributes of the Variant, including product-level Attributes merged at projection time.
- Returns:
- attributes
-
getPrice
The selected price based on the price selection query parameters. Only present when price selection parameters are provided.
- Returns:
- price
-
getDefault
trueif this Variant is the default Variant of its Product (see Product.defaultVariant).falseotherwise.- Returns:
- default
-
build
builds VariantProjection with checking for non-null required values- Specified by:
buildin interfaceBuilder<VariantProjection>- Returns:
- VariantProjection
-
buildUnchecked
builds VariantProjection without checking for non-null required values- Returns:
- VariantProjection
-
of
factory method for an instance of VariantProjectionBuilder- Returns:
- builder
-
of
create builder for VariantProjection instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-