Class VariantAttributesBuilder
- All Implemented Interfaces:
Builder<VariantAttributes>
Example to create an instance using the builder pattern
VariantAttributes variantAttributes = VariantAttributes.builder()
.productId("{productId}")
.plusAttributes(attributesBuilder -> attributesBuilder)
.plusVariants(variantsBuilder -> variantsBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttributes(Function<VariantAttributesAttributeMetadataBuilder, VariantAttributesAttributeMetadata> builder) Metadata for the requested Attributes, derived from the ProductType.All Variants of the Product with their requested Attributes and availability.attributes(VariantAttributesAttributeMetadata... attributes) Metadata for the requested Attributes, derived from the ProductType.attributes(List<VariantAttributesAttributeMetadata> attributes) Metadata for the requested Attributes, derived from the ProductType.build()builds VariantAttributes with checking for non-null required valuesbuilds VariantAttributes without checking for non-null required valuesMetadata for the requested Attributes, derived from the ProductType.Unique identifier of the Product.User-defined unique identifier of the Product.All Variants of the Product with their requested Attributes and availability.static VariantAttributesBuilderof()factory method for an instance of VariantAttributesBuilderstatic VariantAttributesBuilderof(VariantAttributes template) create builder for VariantAttributes instanceplusAttributes(VariantAttributesAttributeMetadata... attributes) Metadata for the requested Attributes, derived from the ProductType.plusAttributes(Function<VariantAttributesAttributeMetadataBuilder, VariantAttributesAttributeMetadataBuilder> builder) Metadata for the requested Attributes, derived from the ProductType.plusVariants(VariantAttributesVariant... variants) All Variants of the Product with their requested Attributes and availability.All Variants of the Product with their requested Attributes and availability.Unique identifier of the Product.productKey(String productKey) User-defined unique identifier of the Product.setAttributes(Function<VariantAttributesAttributeMetadataBuilder, VariantAttributesAttributeMetadata> builder) Metadata for the requested Attributes, derived from the ProductType.All Variants of the Product with their requested Attributes and availability.variants(VariantAttributesVariant... variants) All Variants of the Product with their requested Attributes and availability.variants(List<VariantAttributesVariant> variants) All Variants of the Product with their requested Attributes and availability.withAttributes(Function<VariantAttributesAttributeMetadataBuilder, VariantAttributesAttributeMetadataBuilder> builder) Metadata for the requested Attributes, derived from the ProductType.All Variants of the Product with their requested Attributes and availability.
-
Constructor Details
-
VariantAttributesBuilder
public VariantAttributesBuilder()
-
-
Method Details
-
productId
Unique identifier of the Product.
- Parameters:
productId- value to be set- Returns:
- Builder
-
productKey
User-defined unique identifier of the Product.
- Parameters:
productKey- value to be set- Returns:
- Builder
-
attributes
Metadata for the requested Attributes, derived from the ProductType. Attributes not found in the ProductType are silently omitted.
- Parameters:
attributes- value to be set- Returns:
- Builder
-
attributes
Metadata for the requested Attributes, derived from the ProductType. Attributes not found in the ProductType are silently omitted.
- Parameters:
attributes- value to be set- Returns:
- Builder
-
plusAttributes
Metadata for the requested Attributes, derived from the ProductType. Attributes not found in the ProductType are silently omitted.
- Parameters:
attributes- value to be set- Returns:
- Builder
-
plusAttributes
public VariantAttributesBuilder plusAttributes(Function<VariantAttributesAttributeMetadataBuilder, VariantAttributesAttributeMetadataBuilder> builder) Metadata for the requested Attributes, derived from the ProductType. Attributes not found in the ProductType are silently omitted.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
withAttributes
public VariantAttributesBuilder withAttributes(Function<VariantAttributesAttributeMetadataBuilder, VariantAttributesAttributeMetadataBuilder> builder) Metadata for the requested Attributes, derived from the ProductType. Attributes not found in the ProductType are silently omitted.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
addAttributes
public VariantAttributesBuilder addAttributes(Function<VariantAttributesAttributeMetadataBuilder, VariantAttributesAttributeMetadata> builder) Metadata for the requested Attributes, derived from the ProductType. Attributes not found in the ProductType are silently omitted.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
setAttributes
public VariantAttributesBuilder setAttributes(Function<VariantAttributesAttributeMetadataBuilder, VariantAttributesAttributeMetadata> builder) Metadata for the requested Attributes, derived from the ProductType. Attributes not found in the ProductType are silently omitted.
- Parameters:
builder- function to build the attributes value- Returns:
- Builder
-
variants
All Variants of the Product with their requested Attributes and availability.
- Parameters:
variants- value to be set- Returns:
- Builder
-
variants
All Variants of the Product with their requested Attributes and availability.
- Parameters:
variants- value to be set- Returns:
- Builder
-
plusVariants
All Variants of the Product with their requested Attributes and availability.
- Parameters:
variants- value to be set- Returns:
- Builder
-
plusVariants
public VariantAttributesBuilder plusVariants(Function<VariantAttributesVariantBuilder, VariantAttributesVariantBuilder> builder) All Variants of the Product with their requested Attributes and availability.
- Parameters:
builder- function to build the variants value- Returns:
- Builder
-
withVariants
public VariantAttributesBuilder withVariants(Function<VariantAttributesVariantBuilder, VariantAttributesVariantBuilder> builder) All Variants of the Product with their requested Attributes and availability.
- Parameters:
builder- function to build the variants value- Returns:
- Builder
-
addVariants
public VariantAttributesBuilder addVariants(Function<VariantAttributesVariantBuilder, VariantAttributesVariant> builder) All Variants of the Product with their requested Attributes and availability.
- Parameters:
builder- function to build the variants value- Returns:
- Builder
-
setVariants
public VariantAttributesBuilder setVariants(Function<VariantAttributesVariantBuilder, VariantAttributesVariant> builder) All Variants of the Product with their requested Attributes and availability.
- Parameters:
builder- function to build the variants value- Returns:
- Builder
-
getProductId
Unique identifier of the Product.
- Returns:
- productId
-
getProductKey
User-defined unique identifier of the Product.
- Returns:
- productKey
-
getAttributes
Metadata for the requested Attributes, derived from the ProductType. Attributes not found in the ProductType are silently omitted.
- Returns:
- attributes
-
getVariants
All Variants of the Product with their requested Attributes and availability.
- Returns:
- variants
-
build
builds VariantAttributes with checking for non-null required values- Specified by:
buildin interfaceBuilder<VariantAttributes>- Returns:
- VariantAttributes
-
buildUnchecked
builds VariantAttributes without checking for non-null required values- Returns:
- VariantAttributes
-
of
factory method for an instance of VariantAttributesBuilder- Returns:
- builder
-
of
create builder for VariantAttributes instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-