Class TextLineItemBuilder

java.lang.Object
com.commercetools.api.models.shopping_list.TextLineItemBuilder
All Implemented Interfaces:
Builder<TextLineItem>

public class TextLineItemBuilder extends Object implements Builder<TextLineItem>
TextLineItemBuilder
Example to create an instance using the builder pattern

     TextLineItem textLineItem = TextLineItem.builder()
             .addedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .id("{id}")
             .name(nameBuilder -> nameBuilder)
             .quantity(0.3)
             .build()
 
  • Constructor Details

    • TextLineItemBuilder

      public TextLineItemBuilder()
  • Method Details

    • addedAt

      public TextLineItemBuilder addedAt(ZonedDateTime addedAt)

      Date and time (UTC) the TextLineItem was added to the ShoppingList.

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

      Custom Fields of the TextLineItem.

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

      Custom Fields of the TextLineItem.

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

      public TextLineItemBuilder custom(@Nullable CustomFields custom)

      Custom Fields of the TextLineItem.

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

      Description of the TextLineItem.

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

      Description of the TextLineItem.

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

      public TextLineItemBuilder description(@Nullable LocalizedString description)

      Description of the TextLineItem.

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

      public TextLineItemBuilder id(String id)

      Unique identifier of the TextLineItem.

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

      public TextLineItemBuilder key(@Nullable String key)

      User-defined identifier of the TextLineItem. It is unique per ShoppingList.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • name

      Name of the TextLineItem.

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

      Name of the TextLineItem.

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

      Name of the TextLineItem.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • quantity

      public TextLineItemBuilder quantity(Long quantity)

      Number of entries in the TextLineItem.

      Parameters:
      quantity - value to be set
      Returns:
      Builder
    • getAddedAt

      public ZonedDateTime getAddedAt()

      Date and time (UTC) the TextLineItem was added to the ShoppingList.

      Returns:
      addedAt
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields of the TextLineItem.

      Returns:
      custom
    • getDescription

      @Nullable public LocalizedString getDescription()

      Description of the TextLineItem.

      Returns:
      description
    • getId

      public String getId()

      Unique identifier of the TextLineItem.

      Returns:
      id
    • getKey

      @Nullable public String getKey()

      User-defined identifier of the TextLineItem. It is unique per ShoppingList.

      Returns:
      key
    • getName

      public LocalizedString getName()

      Name of the TextLineItem.

      Returns:
      name
    • getQuantity

      public Long getQuantity()

      Number of entries in the TextLineItem.

      Returns:
      quantity
    • build

      public TextLineItem build()
      builds TextLineItem with checking for non-null required values
      Specified by:
      build in interface Builder<TextLineItem>
      Returns:
      TextLineItem
    • buildUnchecked

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

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

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