Class ShoppingListBuilder
- All Implemented Interfaces:
Builder<ShoppingList>
Example to create an instance using the builder pattern
ShoppingList shoppingList = ShoppingList.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.name(nameBuilder -> nameBuilder)
.plusLineItems(lineItemsBuilder -> lineItemsBuilder)
.plusTextLineItems(textLineItemsBuilder -> textLineItemsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionLine Items (containing Products) of the ShoppingList.Line Items (containing text values) of the ShoppingList.anonymousId
(String anonymousId) Identifies ShoppingLists belonging to an anonymous session.build()
builds ShoppingList with checking for non-null required valuesbuilds ShoppingList without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the ShoppingList was initially created.IDs and references that created the ShoppingList.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the ShoppingList.custom
(CustomFields custom) Custom Fields defined for the ShoppingList.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields defined for the ShoppingList.customer
(CustomerReference customer) Reference to a Customer associated with the ShoppingList.Reference to a Customer associated with the ShoppingList.deleteDaysAfterLastModification
(Long deleteDaysAfterLastModification) Number of days after which the ShoppingList will be automatically deleted if it has not been modified.description
(LocalizedString description) Description of the ShoppingList.Description of the ShoppingList.Identifies ShoppingLists belonging to an anonymous session.Date and time (UTC) the ShoppingList was initially created.IDs and references that created the ShoppingList.Custom Fields defined for the ShoppingList.Reference to a Customer associated with the ShoppingList.Number of days after which the ShoppingList will be automatically deleted if it has not been modified.Description of the ShoppingList.getId()
Unique identifier of the ShoppingList.getKey()
User-defined unique identifier of the ShoppingList.Date and time (UTC) the ShoppingList was last updated.IDs and references that last modified the ShoppingList.Line Items (containing Products) of the ShoppingList.getName()
Name of the ShoppingList.getSlug()
Human-readable identifiers usually used as deep-link URL to the related ShoppingList.getStore()
Store to which the ShoppingList is assigned.Line Items (containing text values) of the ShoppingList.Current version of the ShoppingList.Unique identifier of the ShoppingList.User-defined unique identifier of the ShoppingList.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the ShoppingList was last updated.lastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the ShoppingList.IDs and references that last modified the ShoppingList.lineItems
(ShoppingListLineItem... lineItems) Line Items (containing Products) of the ShoppingList.lineItems
(List<ShoppingListLineItem> lineItems) Line Items (containing Products) of the ShoppingList.name
(LocalizedString name) Name of the ShoppingList.Name of the ShoppingList.static ShoppingListBuilder
of()
factory method for an instance of ShoppingListBuilderstatic ShoppingListBuilder
of
(ShoppingList template) create builder for ShoppingList instanceplusLineItems
(ShoppingListLineItem... lineItems) Line Items (containing Products) of the ShoppingList.Line Items (containing Products) of the ShoppingList.plusTextLineItems
(TextLineItem... textLineItems) Line Items (containing text values) of the ShoppingList.Line Items (containing text values) of the ShoppingList.Line Items (containing Products) of the ShoppingList.Line Items (containing text values) of the ShoppingList.slug
(LocalizedString slug) Human-readable identifiers usually used as deep-link URL to the related ShoppingList.Human-readable identifiers usually used as deep-link URL to the related ShoppingList.store
(StoreKeyReference store) Store to which the ShoppingList is assigned.Store to which the ShoppingList is assigned.textLineItems
(TextLineItem... textLineItems) Line Items (containing text values) of the ShoppingList.textLineItems
(List<TextLineItem> textLineItems) Line Items (containing text values) of the ShoppingList.Current version of the ShoppingList.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the ShoppingList.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields defined for the ShoppingList.Reference to a Customer associated with the ShoppingList.Description of the ShoppingList.IDs and references that last modified the ShoppingList.Line Items (containing Products) of the ShoppingList.Name of the ShoppingList.Human-readable identifiers usually used as deep-link URL to the related ShoppingList.Store to which the ShoppingList is assigned.Line Items (containing text values) of the ShoppingList.
-
Constructor Details
-
ShoppingListBuilder
public ShoppingListBuilder()
-
-
Method Details
-
id
Unique identifier of the ShoppingList.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the ShoppingList.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the ShoppingList was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the ShoppingList was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
name
Name of the ShoppingList.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
Name of the ShoppingList.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
Name of the ShoppingList.
- Parameters:
name
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the ShoppingList.
- Parameters:
key
- value to be set- Returns:
- Builder
-
customer
public ShoppingListBuilder customer(Function<CustomerReferenceBuilder, CustomerReferenceBuilder> builder) Reference to a Customer associated with the ShoppingList.
- Parameters:
builder
- function to build the customer value- Returns:
- Builder
-
withCustomer
public ShoppingListBuilder withCustomer(Function<CustomerReferenceBuilder, CustomerReference> builder) Reference to a Customer associated with the ShoppingList.
- Parameters:
builder
- function to build the customer value- Returns:
- Builder
-
customer
Reference to a Customer associated with the ShoppingList.
- Parameters:
customer
- value to be set- Returns:
- Builder
-
slug
Human-readable identifiers usually used as deep-link URL to the related ShoppingList. Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages. The slug must match the pattern
[a-zA-Z0-9_-]{2,256}
. For good performance, indexes are provided for the first 15languages
set on the Project.- Parameters:
builder
- function to build the slug value- Returns:
- Builder
-
withSlug
Human-readable identifiers usually used as deep-link URL to the related ShoppingList. Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages. The slug must match the pattern
[a-zA-Z0-9_-]{2,256}
. For good performance, indexes are provided for the first 15languages
set on the Project.- Parameters:
builder
- function to build the slug value- Returns:
- Builder
-
slug
Human-readable identifiers usually used as deep-link URL to the related ShoppingList. Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages. The slug must match the pattern
[a-zA-Z0-9_-]{2,256}
. For good performance, indexes are provided for the first 15languages
set on the Project.- Parameters:
slug
- value to be set- Returns:
- Builder
-
description
public ShoppingListBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the ShoppingList.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
public ShoppingListBuilder withDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Description of the ShoppingList.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
description
Description of the ShoppingList.
- Parameters:
description
- value to be set- Returns:
- Builder
-
lineItems
Line Items (containing Products) of the ShoppingList.
- Parameters:
lineItems
- value to be set- Returns:
- Builder
-
lineItems
Line Items (containing Products) of the ShoppingList.
- Parameters:
lineItems
- value to be set- Returns:
- Builder
-
plusLineItems
Line Items (containing Products) of the ShoppingList.
- Parameters:
lineItems
- value to be set- Returns:
- Builder
-
plusLineItems
public ShoppingListBuilder plusLineItems(Function<ShoppingListLineItemBuilder, ShoppingListLineItemBuilder> builder) Line Items (containing Products) of the ShoppingList.
- Parameters:
builder
- function to build the lineItems value- Returns:
- Builder
-
withLineItems
public ShoppingListBuilder withLineItems(Function<ShoppingListLineItemBuilder, ShoppingListLineItemBuilder> builder) Line Items (containing Products) of the ShoppingList.
- Parameters:
builder
- function to build the lineItems value- Returns:
- Builder
-
addLineItems
public ShoppingListBuilder addLineItems(Function<ShoppingListLineItemBuilder, ShoppingListLineItem> builder) Line Items (containing Products) of the ShoppingList.
- Parameters:
builder
- function to build the lineItems value- Returns:
- Builder
-
setLineItems
public ShoppingListBuilder setLineItems(Function<ShoppingListLineItemBuilder, ShoppingListLineItem> builder) Line Items (containing Products) of the ShoppingList.
- Parameters:
builder
- function to build the lineItems value- Returns:
- Builder
-
textLineItems
Line Items (containing text values) of the ShoppingList.
- Parameters:
textLineItems
- value to be set- Returns:
- Builder
-
textLineItems
Line Items (containing text values) of the ShoppingList.
- Parameters:
textLineItems
- value to be set- Returns:
- Builder
-
plusTextLineItems
Line Items (containing text values) of the ShoppingList.
- Parameters:
textLineItems
- value to be set- Returns:
- Builder
-
plusTextLineItems
public ShoppingListBuilder plusTextLineItems(Function<TextLineItemBuilder, TextLineItemBuilder> builder) Line Items (containing text values) of the ShoppingList.
- Parameters:
builder
- function to build the textLineItems value- Returns:
- Builder
-
withTextLineItems
public ShoppingListBuilder withTextLineItems(Function<TextLineItemBuilder, TextLineItemBuilder> builder) Line Items (containing text values) of the ShoppingList.
- Parameters:
builder
- function to build the textLineItems value- Returns:
- Builder
-
addTextLineItems
Line Items (containing text values) of the ShoppingList.
- Parameters:
builder
- function to build the textLineItems value- Returns:
- Builder
-
setTextLineItems
Line Items (containing text values) of the ShoppingList.
- Parameters:
builder
- function to build the textLineItems value- Returns:
- Builder
-
deleteDaysAfterLastModification
public ShoppingListBuilder deleteDaysAfterLastModification(@Nullable Long deleteDaysAfterLastModification) Number of days after which the ShoppingList will be automatically deleted if it has not been modified.
- Parameters:
deleteDaysAfterLastModification
- value to be set- Returns:
- Builder
-
anonymousId
Identifies ShoppingLists belonging to an anonymous session.
- Parameters:
anonymousId
- value to be set- Returns:
- Builder
-
store
public ShoppingListBuilder store(Function<StoreKeyReferenceBuilder, StoreKeyReferenceBuilder> builder) Store to which the ShoppingList is assigned.
- Parameters:
builder
- function to build the store value- Returns:
- Builder
-
withStore
Store to which the ShoppingList is assigned.
- Parameters:
builder
- function to build the store value- Returns:
- Builder
-
store
Store to which the ShoppingList is assigned.
- Parameters:
store
- value to be set- Returns:
- Builder
-
custom
Custom Fields defined for the ShoppingList.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields defined for the ShoppingList.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields defined for the ShoppingList.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
lastModifiedBy
public ShoppingListBuilder lastModifiedBy(Function<LastModifiedByBuilder, LastModifiedByBuilder> builder) IDs and references that last modified the ShoppingList.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
public ShoppingListBuilder withLastModifiedBy(Function<LastModifiedByBuilder, LastModifiedBy> builder) IDs and references that last modified the ShoppingList.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the ShoppingList.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the ShoppingList.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the ShoppingList.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the ShoppingList.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the ShoppingList.
- Returns:
- id
-
getVersion
Current version of the ShoppingList.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the ShoppingList was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the ShoppingList was last updated.
- Returns:
- lastModifiedAt
-
getName
Name of the ShoppingList.
- Returns:
- name
-
getKey
User-defined unique identifier of the ShoppingList.
- Returns:
- key
-
getCustomer
Reference to a Customer associated with the ShoppingList.
- Returns:
- customer
-
getSlug
Human-readable identifiers usually used as deep-link URL to the related ShoppingList. Each slug is unique across a Project, but a ShoppingList can have the same slug for different languages. The slug must match the pattern
[a-zA-Z0-9_-]{2,256}
. For good performance, indexes are provided for the first 15languages
set on the Project.- Returns:
- slug
-
getDescription
Description of the ShoppingList.
- Returns:
- description
-
getLineItems
Line Items (containing Products) of the ShoppingList.
- Returns:
- lineItems
-
getTextLineItems
Line Items (containing text values) of the ShoppingList.
- Returns:
- textLineItems
-
getDeleteDaysAfterLastModification
Number of days after which the ShoppingList will be automatically deleted if it has not been modified.
- Returns:
- deleteDaysAfterLastModification
-
getAnonymousId
Identifies ShoppingLists belonging to an anonymous session.
- Returns:
- anonymousId
-
getStore
Store to which the ShoppingList is assigned.
- Returns:
- store
-
getCustom
Custom Fields defined for the ShoppingList.
- Returns:
- custom
-
getLastModifiedBy
IDs and references that last modified the ShoppingList.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the ShoppingList.
- Returns:
- createdBy
-
build
builds ShoppingList with checking for non-null required values- Specified by:
build
in interfaceBuilder<ShoppingList>
- Returns:
- ShoppingList
-
buildUnchecked
builds ShoppingList without checking for non-null required values- Returns:
- ShoppingList
-
of
factory method for an instance of ShoppingListBuilder- Returns:
- builder
-
of
create builder for ShoppingList instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-