Class ShoppingListLineItemBuilder
- All Implemented Interfaces:
Builder<ShoppingListLineItem>
Example to create an instance using the builder pattern
ShoppingListLineItem shoppingListLineItem = ShoppingListLineItem.builder()
.addedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.id("{id}")
.name(nameBuilder -> nameBuilder)
.productId("{productId}")
.productType(productTypeBuilder -> productTypeBuilder)
.quantity(0.3)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddedAt
(ZonedDateTime addedAt) Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.build()
builds ShoppingListLineItem with checking for non-null required valuesbuilds ShoppingListLineItem without checking for non-null required valuescustom
(CustomFields custom) Custom Fields of the ShoppingListLineItem.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields of the ShoppingListLineItem.deactivatedAt
(ZonedDateTime deactivatedAt) If the Product or Product Variant is deleted,deactivatedAt
is the date and time (UTC) of deletion.Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.Custom Fields of the ShoppingListLineItem.If the Product or Product Variant is deleted,deactivatedAt
is the date and time (UTC) of deletion.getId()
Unique identifier of the ShoppingListLineItem.getKey()
User-defined identifier of the ShoppingListLineItem.getName()
Name of the Product.Unique identifier of a Product.Slug of the current ProductData.The Product Type defining the Attributes of the Product.Number of Products in the ShoppingListLineItem.Data of the ProductVariant.id
of the ProductVariant the ShoppingListLineItem refers to.Unique identifier of the ShoppingListLineItem.User-defined identifier of the ShoppingListLineItem.name
(LocalizedString name) Name of the Product.Name of the Product.static ShoppingListLineItemBuilder
of()
factory method for an instance of ShoppingListLineItemBuilderstatic ShoppingListLineItemBuilder
of
(ShoppingListLineItem template) create builder for ShoppingListLineItem instanceUnique identifier of a Product.productSlug
(LocalizedString productSlug) Slug of the current ProductData.Slug of the current ProductData.productType
(ProductTypeReference productType) The Product Type defining the Attributes of the Product.The Product Type defining the Attributes of the Product.Number of Products in the ShoppingListLineItem.variant
(ProductVariant variant) Data of the ProductVariant.Data of the ProductVariant.id
of the ProductVariant the ShoppingListLineItem refers to.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields of the ShoppingListLineItem.Name of the Product.Slug of the current ProductData.The Product Type defining the Attributes of the Product.Data of the ProductVariant.
-
Constructor Details
-
ShoppingListLineItemBuilder
public ShoppingListLineItemBuilder()
-
-
Method Details
-
addedAt
Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.
- Parameters:
addedAt
- value to be set- Returns:
- Builder
-
custom
public ShoppingListLineItemBuilder custom(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields of the ShoppingListLineItem.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields of the ShoppingListLineItem.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields of the ShoppingListLineItem.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
deactivatedAt
If the Product or Product Variant is deleted,
deactivatedAt
is the date and time (UTC) of deletion.This data is updated in an eventual consistent manner when the Product Variant cannot be ordered anymore.
- Parameters:
deactivatedAt
- value to be set- Returns:
- Builder
-
id
Unique identifier of the ShoppingListLineItem.
- Parameters:
id
- value to be set- Returns:
- Builder
-
key
User-defined identifier of the ShoppingListLineItem. It is unique per ShoppingList.
- Parameters:
key
- value to be set- Returns:
- Builder
-
name
public ShoppingListLineItemBuilder name(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Name of the Product.
This data is updated in an eventual consistent manner when the Product's name changes.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
public ShoppingListLineItemBuilder withName(Function<LocalizedStringBuilder, LocalizedString> builder) Name of the Product.
This data is updated in an eventual consistent manner when the Product's name changes.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
Name of the Product.
This data is updated in an eventual consistent manner when the Product's name changes.
- Parameters:
name
- value to be set- Returns:
- Builder
-
productId
Unique identifier of a Product.
- Parameters:
productId
- value to be set- Returns:
- Builder
-
productType
public ShoppingListLineItemBuilder productType(Function<ProductTypeReferenceBuilder, ProductTypeReferenceBuilder> builder) The Product Type defining the Attributes of the Product.
- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
withProductType
public ShoppingListLineItemBuilder withProductType(Function<ProductTypeReferenceBuilder, ProductTypeReference> builder) The Product Type defining the Attributes of the Product.
- Parameters:
builder
- function to build the productType value- Returns:
- Builder
-
productType
The Product Type defining the Attributes of the Product.
- Parameters:
productType
- value to be set- Returns:
- Builder
-
quantity
Number of Products in the ShoppingListLineItem.
- Parameters:
quantity
- value to be set- Returns:
- Builder
-
variantId
id
of the ProductVariant the ShoppingListLineItem refers to. If not set, the ShoppingListLineItem refers to the Master Variant.- Parameters:
variantId
- value to be set- Returns:
- Builder
-
variant
public ShoppingListLineItemBuilder variant(Function<ProductVariantBuilder, ProductVariantBuilder> builder) Data of the ProductVariant.
Returned when expanded using
expand=lineItems[*].variant
. You cannot expand only a single element of the array.- Parameters:
builder
- function to build the variant value- Returns:
- Builder
-
withVariant
public ShoppingListLineItemBuilder withVariant(Function<ProductVariantBuilder, ProductVariant> builder) Data of the ProductVariant.
Returned when expanded using
expand=lineItems[*].variant
. You cannot expand only a single element of the array.- Parameters:
builder
- function to build the variant value- Returns:
- Builder
-
variant
Data of the ProductVariant.
Returned when expanded using
expand=lineItems[*].variant
. You cannot expand only a single element of the array.- Parameters:
variant
- value to be set- Returns:
- Builder
-
productSlug
public ShoppingListLineItemBuilder productSlug(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Slug of the current ProductData.
Returned when expanded using
expand=lineItems[*].productSlug
. You cannot expand only a single element of the array.- Parameters:
builder
- function to build the productSlug value- Returns:
- Builder
-
withProductSlug
public ShoppingListLineItemBuilder withProductSlug(Function<LocalizedStringBuilder, LocalizedString> builder) Slug of the current ProductData.
Returned when expanded using
expand=lineItems[*].productSlug
. You cannot expand only a single element of the array.- Parameters:
builder
- function to build the productSlug value- Returns:
- Builder
-
productSlug
Slug of the current ProductData.
Returned when expanded using
expand=lineItems[*].productSlug
. You cannot expand only a single element of the array.- Parameters:
productSlug
- value to be set- Returns:
- Builder
-
getAddedAt
Date and time (UTC) the ShoppingListLineItem was added to the ShoppingList.
- Returns:
- addedAt
-
getCustom
Custom Fields of the ShoppingListLineItem.
- Returns:
- custom
-
getDeactivatedAt
If the Product or Product Variant is deleted,
deactivatedAt
is the date and time (UTC) of deletion.This data is updated in an eventual consistent manner when the Product Variant cannot be ordered anymore.
- Returns:
- deactivatedAt
-
getId
Unique identifier of the ShoppingListLineItem.
- Returns:
- id
-
getKey
User-defined identifier of the ShoppingListLineItem. It is unique per ShoppingList.
- Returns:
- key
-
getName
Name of the Product.
This data is updated in an eventual consistent manner when the Product's name changes.
- Returns:
- name
-
getProductId
Unique identifier of a Product.
- Returns:
- productId
-
getProductType
The Product Type defining the Attributes of the Product.
- Returns:
- productType
-
getQuantity
Number of Products in the ShoppingListLineItem.
- Returns:
- quantity
-
getVariantId
id
of the ProductVariant the ShoppingListLineItem refers to. If not set, the ShoppingListLineItem refers to the Master Variant.- Returns:
- variantId
-
getVariant
Data of the ProductVariant.
Returned when expanded using
expand=lineItems[*].variant
. You cannot expand only a single element of the array.- Returns:
- variant
-
getProductSlug
Slug of the current ProductData.
Returned when expanded using
expand=lineItems[*].productSlug
. You cannot expand only a single element of the array.- Returns:
- productSlug
-
build
builds ShoppingListLineItem with checking for non-null required values- Specified by:
build
in interfaceBuilder<ShoppingListLineItem>
- Returns:
- ShoppingListLineItem
-
buildUnchecked
builds ShoppingListLineItem without checking for non-null required values- Returns:
- ShoppingListLineItem
-
of
factory method for an instance of ShoppingListLineItemBuilder- Returns:
- builder
-
of
create builder for ShoppingListLineItem instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-