Class LineItemBuilder
java.lang.Object
com.commercetools.history.models.common.LineItemBuilder
LineItemBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
LineItem lineItem = LineItem.builder()
.addedAt("{addedAt}")
.custom(customBuilder -> customBuilder)
.id("{id}")
.name(nameBuilder -> nameBuilder)
.productId("{productId}")
.productSlug(productSlugBuilder -> productSlugBuilder)
.productType(productTypeBuilder -> productTypeBuilder)
.quantity(1)
.variant(variantBuilder -> variantBuilder)
.variantId(1)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionset the value to the addedAtbuild()
builds LineItem with checking for non-null required valuesbuilds LineItem without checking for non-null required valuescustom
(CustomFields custom) set the value to the customcustom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) set the value to the custom using the builder functionvalue of addedAt}value of custom}getId()
value of id}getName()
value of name}value of productId}value of productSlug}value of productType}value of quantity}value of variant}value of variantId}set the value to the idname
(LocalizedString name) set the value to the nameset the value to the name using the builder functionstatic LineItemBuilder
of()
factory method for an instance of LineItemBuilderstatic LineItemBuilder
create builder for LineItem instanceset the value to the productIdproductSlug
(LocalizedString productSlug) set the value to the productSlugset the value to the productSlug using the builder functionproductType
(Reference productType) set the value to the productTypeproductType
(Function<ReferenceBuilder, ReferenceBuilder> builder) set the value to the productType using the builder functionset the value to the quantityset the value to the variantvariant
(Function<VariantBuilder, VariantBuilder> builder) set the value to the variant using the builder functionset the value to the variantIdwithCustom
(Function<CustomFieldsBuilder, CustomFields> builder) set the value to the custom using the builder functionset the value to the name using the builder functionset the value to the productSlug using the builder functionwithProductType
(Function<ReferenceBuilder, Reference> builder) set the value to the productType using the builder functionwithVariant
(Function<VariantBuilder, Variant> builder) set the value to the variant using the builder function
-
Constructor Details
-
LineItemBuilder
public LineItemBuilder()
-
-
Method Details
-
addedAt
set the value to the addedAt- Parameters:
addedAt
- value to be set- Returns:
- Builder
-
custom
set the value to the custom using the builder function- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
set the value to the custom using the builder function- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
set the value to the custom- Parameters:
custom
- value to be set- Returns:
- Builder
-
id
set the value to the id- Parameters:
id
- value to be set- Returns:
- Builder
-
name
set the value to the name using the builder function- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
set the value to the name using the builder function- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
set the value to the name- Parameters:
name
- value to be set- Returns:
- Builder
-
productId
set the value to the productId- Parameters:
productId
- value to be set- Returns:
- Builder
-
productSlug
set the value to the productSlug using the builder function- Parameters:
builder
- function to build the productSlug value- Returns:
- Builder
-
withProductSlug
set the value to the productSlug using the builder function- Parameters:
builder
- function to build the productSlug value- Returns:
- Builder
-
productSlug
set the value to the productSlug- Parameters:
productSlug
- value to be set- Returns:
- Builder
-
productType
set the value to the productType using the builder function- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
withProductType
set the value to the productType using the builder function- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
productType
set the value to the productType- Parameters:
productType
- value to be set- Returns:
- Builder
-
quantity
set the value to the quantity- Parameters:
quantity
- value to be set- Returns:
- Builder
-
variant
set the value to the variant using the builder function- Parameters:
builder
- function to build the variant value- Returns:
- Builder
-
withVariant
set the value to the variant using the builder function- Parameters:
builder
- function to build the variant value- Returns:
- Builder
-
variant
set the value to the variant- Parameters:
variant
- value to be set- Returns:
- Builder
-
variantId
set the value to the variantId- Parameters:
variantId
- value to be set- Returns:
- Builder
-
getAddedAt
value of addedAt}- Returns:
- addedAt
-
getCustom
value of custom}- Returns:
- custom
-
getId
value of id}- Returns:
- id
-
getName
value of name}- Returns:
- name
-
getProductId
value of productId}- Returns:
- productId
-
getProductSlug
value of productSlug}- Returns:
- productSlug
-
getProductType
value of productType}- Returns:
- productType
-
getQuantity
value of quantity}- Returns:
- quantity
-
getVariant
value of variant}- Returns:
- variant
-
getVariantId
value of variantId}- Returns:
- variantId
-
build
builds LineItem with checking for non-null required values -
buildUnchecked
builds LineItem without checking for non-null required values- Returns:
- LineItem
-
of
factory method for an instance of LineItemBuilder- Returns:
- builder
-
of
create builder for LineItem instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-