Class LineItemReturnItemBuilder

java.lang.Object
com.commercetools.api.models.order.LineItemReturnItemBuilder
All Implemented Interfaces:
Builder<LineItemReturnItem>

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

     LineItemReturnItem lineItemReturnItem = LineItemReturnItem.builder()
             .id("{id}")
             .quantity(0.3)
             .shipmentState(ReturnShipmentState.ADVISED)
             .paymentState(ReturnPaymentState.NON_REFUNDABLE)
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lineItemId("{lineItemId}")
             .build()
 
  • Constructor Details

    • LineItemReturnItemBuilder

      public LineItemReturnItemBuilder()
  • Method Details

    • id

      Unique identifier of the Return Item.

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

      User-defined unique identifier of the LineItemReturnItem.

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

      public LineItemReturnItemBuilder quantity(Long quantity)

      Number of Line Items returned.

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

      public LineItemReturnItemBuilder comment(@Nullable String comment)

      User-defined description for the return.

      Parameters:
      comment - value to be set
      Returns:
      Builder
    • shipmentState

      public LineItemReturnItemBuilder shipmentState(ReturnShipmentState shipmentState)

      Shipment status of the Return Item.

      Parameters:
      shipmentState - value to be set
      Returns:
      Builder
    • paymentState

      public LineItemReturnItemBuilder paymentState(ReturnPaymentState paymentState)

      Payment status of the Return Item:

      • NonRefundable, for items in the Advised ReturnShipmentState
      • Initial, for items in the Returned ReturnShipmentState
      Parameters:
      paymentState - value to be set
      Returns:
      Builder
    • custom

      Custom Fields of the Return Item.

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

      Custom Fields of the Return Item.

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

      Custom Fields of the Return Item.

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

      public LineItemReturnItemBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Return Item was last updated.

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

      public LineItemReturnItemBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the Return Item was intitially created.

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

      public LineItemReturnItemBuilder lineItemId(String lineItemId)

      id of the returned LineItem.

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

      public String getId()

      Unique identifier of the Return Item.

      Returns:
      id
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the LineItemReturnItem.

      Returns:
      key
    • getQuantity

      public Long getQuantity()

      Number of Line Items returned.

      Returns:
      quantity
    • getComment

      @Nullable public String getComment()

      User-defined description for the return.

      Returns:
      comment
    • getShipmentState

      public ReturnShipmentState getShipmentState()

      Shipment status of the Return Item.

      Returns:
      shipmentState
    • getPaymentState

      public ReturnPaymentState getPaymentState()

      Payment status of the Return Item:

      • NonRefundable, for items in the Advised ReturnShipmentState
      • Initial, for items in the Returned ReturnShipmentState
      Returns:
      paymentState
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields of the Return Item.

      Returns:
      custom
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Return Item was last updated.

      Returns:
      lastModifiedAt
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the Return Item was intitially created.

      Returns:
      createdAt
    • getLineItemId

      public String getLineItemId()

      id of the returned LineItem.

      Returns:
      lineItemId
    • build

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

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

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

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