Class ReturnItemDraftBuilder

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

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

     ReturnItemDraft returnItemDraft = ReturnItemDraft.builder()
             .quantity(0.3)
             .shipmentState(ReturnShipmentState.ADVISED)
             .build()
 
  • Constructor Details

    • ReturnItemDraftBuilder

      public ReturnItemDraftBuilder()
  • Method Details

    • key

      User-defined unique identifier of the Return Item.

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

      public ReturnItemDraftBuilder quantity(Long quantity)

      Number of Line Items or Custom Line Items to return.

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

      public ReturnItemDraftBuilder lineItemId(@Nullable String lineItemId)

      id of the LineItem to return.

      Required if Line Items are returned, to create a LineItemReturnItem.

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

      public ReturnItemDraftBuilder customLineItemId(@Nullable String customLineItemId)

      id of the CustomLineItem to return.

      Required if Custom Line Items are returned, to create a CustomLineItemReturnItem.

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

      public ReturnItemDraftBuilder comment(@Nullable String comment)

      User-defined description for the return.

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

      public ReturnItemDraftBuilder shipmentState(ReturnShipmentState shipmentState)

      Shipment status of the item to be returned. Can either be Advised or Returned only.

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

      Custom Fields for the Return Item.

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

      Custom Fields for the Return Item.

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

      Custom Fields for the Return Item.

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

      @Nullable public String getKey()

      User-defined unique identifier of the Return Item.

      Returns:
      key
    • getQuantity

      public Long getQuantity()

      Number of Line Items or Custom Line Items to return.

      Returns:
      quantity
    • getLineItemId

      @Nullable public String getLineItemId()

      id of the LineItem to return.

      Required if Line Items are returned, to create a LineItemReturnItem.

      Returns:
      lineItemId
    • getCustomLineItemId

      @Nullable public String getCustomLineItemId()

      id of the CustomLineItem to return.

      Required if Custom Line Items are returned, to create a CustomLineItemReturnItem.

      Returns:
      customLineItemId
    • getComment

      @Nullable public String getComment()

      User-defined description for the return.

      Returns:
      comment
    • getShipmentState

      public ReturnShipmentState getShipmentState()

      Shipment status of the item to be returned. Can either be Advised or Returned only.

      Returns:
      shipmentState
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields for the Return Item.

      Returns:
      custom
    • build

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

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

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

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