Class VariantValuesBuilder
java.lang.Object
com.commercetools.api.models.error.VariantValuesBuilder
- All Implemented Interfaces:
Builder<VariantValues>
VariantValuesBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
VariantValues variantValues = VariantValues.builder()
.plusPrices(pricesBuilder -> pricesBuilder)
.plusAttributes(attributesBuilder -> attributesBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAttributes
(Function<AttributeBuilder, Attribute> builder) Attributes of the ProductVariant.addPrices
(Function<PriceDraftBuilder, PriceDraft> builder) Embedded Prices of the ProductVariant.attributes
(Attribute... attributes) Attributes of the ProductVariant.attributes
(List<Attribute> attributes) Attributes of the ProductVariant.build()
builds VariantValues with checking for non-null required valuesbuilds VariantValues without checking for non-null required valuesAttributes of the ProductVariant.Embedded Prices of the ProductVariant.getSku()
SKU of the ProductVariant.static VariantValuesBuilder
of()
factory method for an instance of VariantValuesBuilderstatic VariantValuesBuilder
of
(VariantValues template) create builder for VariantValues instanceplusAttributes
(Attribute... attributes) Attributes of the ProductVariant.Attributes of the ProductVariant.plusPrices
(PriceDraft... prices) Embedded Prices of the ProductVariant.plusPrices
(Function<PriceDraftBuilder, PriceDraftBuilder> builder) Embedded Prices of the ProductVariant.prices
(PriceDraft... prices) Embedded Prices of the ProductVariant.prices
(List<PriceDraft> prices) Embedded Prices of the ProductVariant.setAttributes
(Function<AttributeBuilder, Attribute> builder) Attributes of the ProductVariant.setPrices
(Function<PriceDraftBuilder, PriceDraft> builder) Embedded Prices of the ProductVariant.SKU of the ProductVariant.Attributes of the ProductVariant.withPrices
(Function<PriceDraftBuilder, PriceDraftBuilder> builder) Embedded Prices of the ProductVariant.
-
Constructor Details
-
VariantValuesBuilder
public VariantValuesBuilder()
-
-
Method Details
-
sku
SKU of the ProductVariant.
- Parameters:
sku
- value to be set- Returns:
- Builder
-
prices
Embedded Prices of the ProductVariant.
- Parameters:
prices
- value to be set- Returns:
- Builder
-
prices
Embedded Prices of the ProductVariant.
- Parameters:
prices
- value to be set- Returns:
- Builder
-
plusPrices
Embedded Prices of the ProductVariant.
- Parameters:
prices
- value to be set- Returns:
- Builder
-
plusPrices
Embedded Prices of the ProductVariant.
- Parameters:
builder
- function to build the prices value- Returns:
- Builder
-
withPrices
Embedded Prices of the ProductVariant.
- Parameters:
builder
- function to build the prices value- Returns:
- Builder
-
addPrices
Embedded Prices of the ProductVariant.
- Parameters:
builder
- function to build the prices value- Returns:
- Builder
-
setPrices
Embedded Prices of the ProductVariant.
- Parameters:
builder
- function to build the prices value- Returns:
- Builder
-
attributes
Attributes of the ProductVariant.
- Parameters:
attributes
- value to be set- Returns:
- Builder
-
attributes
Attributes of the ProductVariant.
- Parameters:
attributes
- value to be set- Returns:
- Builder
-
plusAttributes
Attributes of the ProductVariant.
- Parameters:
attributes
- value to be set- Returns:
- Builder
-
plusAttributes
Attributes of the ProductVariant.
- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
-
withAttributes
Attributes of the ProductVariant.
- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
-
addAttributes
Attributes of the ProductVariant.
- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
-
setAttributes
Attributes of the ProductVariant.
- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
-
getSku
SKU of the ProductVariant.
- Returns:
- sku
-
getPrices
Embedded Prices of the ProductVariant.
- Returns:
- prices
-
getAttributes
Attributes of the ProductVariant.
- Returns:
- attributes
-
build
builds VariantValues with checking for non-null required values- Specified by:
build
in interfaceBuilder<VariantValues>
- Returns:
- VariantValues
-
buildUnchecked
builds VariantValues without checking for non-null required values- Returns:
- VariantValues
-
of
factory method for an instance of VariantValuesBuilder- Returns:
- builder
-
of
create builder for VariantValues instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-