Class ShoppingListBuilder

java.lang.Object
com.commercetools.api.models.shopping_list.ShoppingListBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<ShoppingList>

public class ShoppingListBuilder extends Object implements io.vrap.rmf.base.client.Builder<ShoppingList>
ShoppingListBuilder
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 Details

    • ShoppingListBuilder

      public ShoppingListBuilder()
  • Method Details

    • id

      public ShoppingListBuilder id(String id)

      Unique identifier of the ShoppingList.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public ShoppingListBuilder version(Long version)

      Current version of the ShoppingList.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      public ShoppingListBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the ShoppingList was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public ShoppingListBuilder lastModifiedAt(ZonedDateTime 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

      Reference to a Customer associated with the ShoppingList.

      Parameters:
      builder - function to build the customer value
      Returns:
      Builder
    • withCustomer

      Reference to a Customer associated with the ShoppingList.

      Parameters:
      builder - function to build the customer value
      Returns:
      Builder
    • customer

      public ShoppingListBuilder customer(@Nullable CustomerReference 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 15 languages 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 15 languages 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 15 languages set on the Project.

      Parameters:
      slug - value to be set
      Returns:
      Builder
    • description

      Description of the ShoppingList.

      Parameters:
      builder - function to build the description value
      Returns:
      Builder
    • withDescription

      Description of the ShoppingList.

      Parameters:
      builder - function to build the description value
      Returns:
      Builder
    • description

      public ShoppingListBuilder description(@Nullable LocalizedString description)

      Description of the ShoppingList.

      Parameters:
      description - value to be set
      Returns:
      Builder
    • lineItems

      public ShoppingListBuilder lineItems(ShoppingListLineItem... lineItems)

      Line Items (containing Products) of the ShoppingList.

      Parameters:
      lineItems - value to be set
      Returns:
      Builder
    • lineItems

      public ShoppingListBuilder lineItems(List<ShoppingListLineItem> lineItems)

      Line Items (containing Products) of the ShoppingList.

      Parameters:
      lineItems - value to be set
      Returns:
      Builder
    • plusLineItems

      public ShoppingListBuilder plusLineItems(ShoppingListLineItem... 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:
      builder - function to build the lineItems value
      Returns:
      Builder
    • withLineItems

      Line Items (containing Products) of the ShoppingList.

      Parameters:
      builder - function to build the lineItems value
      Returns:
      Builder
    • addLineItems

      Line Items (containing Products) of the ShoppingList.

      Parameters:
      builder - function to build the lineItems value
      Returns:
      Builder
    • setLineItems

      Line Items (containing Products) of the ShoppingList.

      Parameters:
      builder - function to build the lineItems value
      Returns:
      Builder
    • textLineItems

      public ShoppingListBuilder textLineItems(TextLineItem... textLineItems)

      Line Items (containing text values) of the ShoppingList.

      Parameters:
      textLineItems - value to be set
      Returns:
      Builder
    • textLineItems

      public ShoppingListBuilder textLineItems(List<TextLineItem> textLineItems)

      Line Items (containing text values) of the ShoppingList.

      Parameters:
      textLineItems - value to be set
      Returns:
      Builder
    • plusTextLineItems

      public ShoppingListBuilder plusTextLineItems(TextLineItem... 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:
      builder - function to build the textLineItems value
      Returns:
      Builder
    • withTextLineItems

      Line Items (containing text values) of the ShoppingList.

      Parameters:
      builder - function to build the textLineItems value
      Returns:
      Builder
    • addTextLineItems

      public ShoppingListBuilder addTextLineItems(Function<TextLineItemBuilder,TextLineItem> builder)

      Line Items (containing text values) of the ShoppingList.

      Parameters:
      builder - function to build the textLineItems value
      Returns:
      Builder
    • setTextLineItems

      public ShoppingListBuilder setTextLineItems(Function<TextLineItemBuilder,TextLineItem> builder)

      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

      public ShoppingListBuilder anonymousId(@Nullable String anonymousId)

      Identifies ShoppingLists belonging to an anonymous session.

      Parameters:
      anonymousId - value to be set
      Returns:
      Builder
    • store

      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

      public ShoppingListBuilder custom(@Nullable CustomFields custom)

      Custom Fields defined for the ShoppingList.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • lastModifiedBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the lastModifiedBy value
      Returns:
      Builder
    • withLastModifiedBy

      public ShoppingListBuilder withLastModifiedBy(Function<LastModifiedByBuilder,LastModifiedBy> builder)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the lastModifiedBy value
      Returns:
      Builder
    • lastModifiedBy

      public ShoppingListBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the createdBy value
      Returns:
      Builder
    • withCreatedBy

      public ShoppingListBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      builder - function to build the createdBy value
      Returns:
      Builder
    • createdBy

      public ShoppingListBuilder createdBy(@Nullable CreatedBy createdBy)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      createdBy - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the ShoppingList.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the ShoppingList.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the ShoppingList was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the ShoppingList was last updated.

      Returns:
      lastModifiedAt
    • getName

      public LocalizedString getName()

      Name of the ShoppingList.

      Returns:
      name
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the ShoppingList.

      Returns:
      key
    • getCustomer

      @Nullable public CustomerReference getCustomer()

      Reference to a Customer associated with the ShoppingList.

      Returns:
      customer
    • getSlug

      @Nullable public LocalizedString 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 15 languages set on the Project.

      Returns:
      slug
    • getDescription

      @Nullable public LocalizedString getDescription()

      Description of the ShoppingList.

      Returns:
      description
    • getLineItems

      public List<ShoppingListLineItem> getLineItems()

      Line Items (containing Products) of the ShoppingList.

      Returns:
      lineItems
    • getTextLineItems

      public List<TextLineItem> getTextLineItems()

      Line Items (containing text values) of the ShoppingList.

      Returns:
      textLineItems
    • getDeleteDaysAfterLastModification

      @Nullable public Long getDeleteDaysAfterLastModification()

      Number of days after which the ShoppingList will be automatically deleted if it has not been modified.

      Returns:
      deleteDaysAfterLastModification
    • getAnonymousId

      @Nullable public String getAnonymousId()

      Identifies ShoppingLists belonging to an anonymous session.

      Returns:
      anonymousId
    • getStore

      @Nullable public StoreKeyReference getStore()

      Store to which the ShoppingList is assigned.

      Returns:
      store
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields defined for the ShoppingList.

      Returns:
      custom
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      createdBy
    • build

      public ShoppingList build()
      builds ShoppingList with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<ShoppingList>
      Returns:
      ShoppingList
    • buildUnchecked

      public ShoppingList buildUnchecked()
      builds ShoppingList without checking for non-null required values
      Returns:
      ShoppingList
    • of

      public static ShoppingListBuilder of()
      factory method for an instance of ShoppingListBuilder
      Returns:
      builder
    • of

      public static ShoppingListBuilder of(ShoppingList template)
      create builder for ShoppingList instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder