Class ProductTypeDraftBuilder
- All Implemented Interfaces:
Builder<ProductTypeDraft>
Example to create an instance using the builder pattern
ProductTypeDraft productTypeDraft = ProductTypeDraft.builder()
.name("{name}")
.description("{description}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAttributes to specify for the ProductType.attributes
(AttributeDefinitionDraft... attributes) Attributes to specify for the ProductType.attributes
(List<AttributeDefinitionDraft> attributes) Attributes to specify for the ProductType.build()
builds ProductTypeDraft with checking for non-null required valuesbuilds ProductTypeDraft without checking for non-null required valuesdescription
(String description) Description of the ProductType.Attributes to specify for the ProductType.Description of the ProductType.getKey()
User-defined unique identifier for the ProductType.getName()
Name of the ProductType.User-defined unique identifier for the ProductType.Name of the ProductType.static ProductTypeDraftBuilder
of()
factory method for an instance of ProductTypeDraftBuilderstatic ProductTypeDraftBuilder
of
(ProductTypeDraft template) create builder for ProductTypeDraft instanceplusAttributes
(AttributeDefinitionDraft... attributes) Attributes to specify for the ProductType.Attributes to specify for the ProductType.Attributes to specify for the ProductType.Attributes to specify for the ProductType.
-
Constructor Details
-
ProductTypeDraftBuilder
public ProductTypeDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier for the ProductType.
- Parameters:
key
- value to be set- Returns:
- Builder
-
name
Name of the ProductType.
- Parameters:
name
- value to be set- Returns:
- Builder
-
description
Description of the ProductType.
- Parameters:
description
- value to be set- Returns:
- Builder
-
attributes
Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.
- Parameters:
attributes
- value to be set- Returns:
- Builder
-
attributes
Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.
- Parameters:
attributes
- value to be set- Returns:
- Builder
-
plusAttributes
Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.
- Parameters:
attributes
- value to be set- Returns:
- Builder
-
plusAttributes
public ProductTypeDraftBuilder plusAttributes(Function<AttributeDefinitionDraftBuilder, AttributeDefinitionDraftBuilder> builder) Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.
- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
-
withAttributes
public ProductTypeDraftBuilder withAttributes(Function<AttributeDefinitionDraftBuilder, AttributeDefinitionDraftBuilder> builder) Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.
- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
-
addAttributes
public ProductTypeDraftBuilder addAttributes(Function<AttributeDefinitionDraftBuilder, AttributeDefinitionDraft> builder) Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.
- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
-
setAttributes
public ProductTypeDraftBuilder setAttributes(Function<AttributeDefinitionDraftBuilder, AttributeDefinitionDraft> builder) Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.
- Parameters:
builder
- function to build the attributes value- Returns:
- Builder
-
getKey
User-defined unique identifier for the ProductType.
- Returns:
- key
-
getName
Name of the ProductType.
- Returns:
- name
-
getDescription
Description of the ProductType.
- Returns:
- description
-
getAttributes
Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.
- Returns:
- attributes
-
build
builds ProductTypeDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductTypeDraft>
- Returns:
- ProductTypeDraft
-
buildUnchecked
builds ProductTypeDraft without checking for non-null required values- Returns:
- ProductTypeDraft
-
of
factory method for an instance of ProductTypeDraftBuilder- Returns:
- builder
-
of
create builder for ProductTypeDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-