Class CustomLineItemReturnItemBuilder

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

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

     CustomLineItemReturnItem customLineItemReturnItem = CustomLineItemReturnItem.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"))
             .customLineItemId("{customLineItemId}")
             .build()
 
  • Constructor Details

    • CustomLineItemReturnItemBuilder

      public CustomLineItemReturnItemBuilder()
  • Method Details

    • id

      Unique identifier of the Return Item.

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

      User-defined unique identifier of the CustomLineItemReturnItem.

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

      public CustomLineItemReturnItemBuilder quantity(Long quantity)

      Number of Custom Line Items returned.

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

      User-defined description for the return.

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

      public CustomLineItemReturnItemBuilder shipmentState(ReturnShipmentState shipmentState)

      Shipment status of the Return Item.

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

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

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

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

      public CustomLineItemReturnItemBuilder createdAt(ZonedDateTime createdAt)

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

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

      public CustomLineItemReturnItemBuilder customLineItemId(String customLineItemId)

      id of the returned CustomLineItem.

      Parameters:
      customLineItemId - 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 CustomLineItemReturnItem.

      Returns:
      key
    • getQuantity

      public Long getQuantity()

      Number of Custom 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
    • getCustomLineItemId

      public String getCustomLineItemId()

      id of the returned CustomLineItem.

      Returns:
      customLineItemId
    • build

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

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

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

      create builder for CustomLineItemReturnItem instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder