Class ShoppingListLineItemDraftBuilder
- All Implemented Interfaces:
Builder<ShoppingListLineItemDraft>
Example to create an instance using the builder pattern
ShoppingListLineItemDraft shoppingListLineItemDraft = ShoppingListLineItemDraft.builder()
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddedAt(ZonedDateTime addedAt) Date and time the ShoppingListLineItem is added to the ShoppingList.build()builds ShoppingListLineItemDraft with checking for non-null required valuesbuilds ShoppingListLineItemDraft without checking for non-null required valuescustom(CustomFieldsDraft custom) Custom Fields for the ShoppingListLineItem.Custom Fields for the ShoppingListLineItem.Date and time the ShoppingListLineItem is added to the ShoppingList.Custom Fields for the ShoppingListLineItem.getKey()User-defined identifier of the ShoppingListLineItem.Unique identifier of a Product.Number of Products in the ShoppingListLineItem.getSku()skuof the ProductVariant.idof the ProductVariant.User-defined identifier of the ShoppingListLineItem.of()factory method for an instance of ShoppingListLineItemDraftBuilderof(ShoppingListLineItemDraft template) create builder for ShoppingListLineItemDraft instanceUnique identifier of a Product.Number of Products in the ShoppingListLineItem.skuof the ProductVariant.idof the ProductVariant.Custom Fields for the ShoppingListLineItem.
-
Constructor Details
-
ShoppingListLineItemDraftBuilder
public ShoppingListLineItemDraftBuilder()
-
-
Method Details
-
key
User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.
- Parameters:
key- value to be set- Returns:
- Builder
-
productId
Unique identifier of a Product.
- Parameters:
productId- value to be set- Returns:
- Builder
-
variantId
idof the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.For a Project with ProductCatalogModel set to
Modular, whenvariantIdis not set, the ShoppingListLineItem refers to the Product's default Variant (defaultVariant) instead of the Master Variant. If no default Variant is set, the ShoppingListLineItem refers to the Variant with the lowestvariantId.- Parameters:
variantId- value to be set- Returns:
- Builder
-
sku
skuof the ProductVariant.- Parameters:
sku- value to be set- Returns:
- Builder
-
addedAt
Date and time the ShoppingListLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.
- Parameters:
addedAt- value to be set- Returns:
- Builder
-
custom
public ShoppingListLineItemDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the ShoppingListLineItem.
- Parameters:
builder- function to build the custom value- Returns:
- Builder
-
withCustom
public ShoppingListLineItemDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields for the ShoppingListLineItem.
- Parameters:
builder- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the ShoppingListLineItem.
- Parameters:
custom- value to be set- Returns:
- Builder
-
quantity
Number of Products in the ShoppingListLineItem.
- Parameters:
quantity- value to be set- Returns:
- Builder
-
getKey
User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.
- Returns:
- key
-
getProductId
Unique identifier of a Product.
- Returns:
- productId
-
getVariantId
idof the ProductVariant. If not set, the ShoppingListLineItem refers to the Master Variant.For a Project with ProductCatalogModel set to
Modular, whenvariantIdis not set, the ShoppingListLineItem refers to the Product's default Variant (defaultVariant) instead of the Master Variant. If no default Variant is set, the ShoppingListLineItem refers to the Variant with the lowestvariantId.- Returns:
- variantId
-
getSku
skuof the ProductVariant.- Returns:
- sku
-
getAddedAt
Date and time the ShoppingListLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.
- Returns:
- addedAt
-
getCustom
Custom Fields for the ShoppingListLineItem.
- Returns:
- custom
-
getQuantity
Number of Products in the ShoppingListLineItem.
- Returns:
- quantity
-
build
builds ShoppingListLineItemDraft with checking for non-null required values- Specified by:
buildin interfaceBuilder<ShoppingListLineItemDraft>- Returns:
- ShoppingListLineItemDraft
-
buildUnchecked
builds ShoppingListLineItemDraft without checking for non-null required values- Returns:
- ShoppingListLineItemDraft
-
of
factory method for an instance of ShoppingListLineItemDraftBuilder- Returns:
- builder
-
of
create builder for ShoppingListLineItemDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-