Class VariantValuesBuilder
java.lang.Object
com.commercetools.importapi.models.errors.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPrices(Function<PriceImportBuilder, PriceImport> builder) add the value to the prices using the builder functionattributes(Attribute... attributes) set values to the attributesattributes(List<Attribute> attributes) set value to the attributesbuild()builds VariantValues with checking for non-null required valuesbuilds VariantValues without checking for non-null required valuesvalue of attributes}value of prices}getSku()The SKU of the Product Variant.static VariantValuesBuilderof()factory method for an instance of VariantValuesBuilderstatic VariantValuesBuilderof(VariantValues template) create builder for VariantValues instanceplusAttributes(Attribute... attributes) add values to the attributesplusAttributes(Function<AttributeBuilder, Builder<? extends Attribute>> builder) add a value to the attributes using the builder functionplusPrices(PriceImport... prices) add values to the pricesadd the value to the prices using the builder functionprices(PriceImport... prices) set values to the pricesprices(List<PriceImport> prices) set value to the pricessetPrices(Function<PriceImportBuilder, PriceImport> builder) set the value to the prices using the builder functionThe SKU of the Product Variant.withAttributes(Function<AttributeBuilder, Builder<? extends Attribute>> builder) set the value to the attributes using the builder functionset the value to the prices using the builder function
-
Constructor Details
-
VariantValuesBuilder
public VariantValuesBuilder()
-
-
Method Details
-
sku
The SKU of the Product Variant.
- Parameters:
sku- value to be set- Returns:
- Builder
-
prices
set values to the prices- Parameters:
prices- value to be set- Returns:
- Builder
-
prices
set value to the prices- Parameters:
prices- value to be set- Returns:
- Builder
-
plusPrices
add values to the prices- Parameters:
prices- value to be set- Returns:
- Builder
-
plusPrices
add the value to the prices using the builder function- Parameters:
builder- function to build the prices value- Returns:
- Builder
-
withPrices
set the value to the prices using the builder function- Parameters:
builder- function to build the prices value- Returns:
- Builder
-
addPrices
add the value to the prices using the builder function- Parameters:
builder- function to build the prices value- Returns:
- Builder
-
setPrices
set the value to the prices using the builder function- Parameters:
builder- function to build the prices value- Returns:
- Builder
-
attributes
set values to the attributes- Parameters:
attributes- value to be set- Returns:
- Builder
-
attributes
set value to the attributes- Parameters:
attributes- value to be set- Returns:
- Builder
-
plusAttributes
add values to the attributes- Parameters:
attributes- value to be set- Returns:
- Builder
-
plusAttributes
public VariantValuesBuilder plusAttributes(Function<AttributeBuilder, Builder<? extends Attribute>> builder) add a value to the attributes using the builder function- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
withAttributes
public VariantValuesBuilder withAttributes(Function<AttributeBuilder, Builder<? extends Attribute>> builder) set the value to the attributes using the builder function- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
getSku
The SKU of the Product Variant.
- Returns:
- sku
-
getPrices
value of prices}- Returns:
- prices
-
getAttributes
value of attributes}- Returns:
- attributes
-
build
builds VariantValues with checking for non-null required values- Specified by:
buildin 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
-