Class ReturnItemBuilder

java.lang.Object
com.commercetools.history.models.common.ReturnItemBuilder
All Implemented Interfaces:
Builder<ReturnItem>

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

     ReturnItem returnItem = ReturnItem.builder()
             .id("{id}")
             .quantity(0.3)
             .type("{type}")
             .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"))
             .build()
 
  • Constructor Details

    • ReturnItemBuilder

      public ReturnItemBuilder()
  • Method Details

    • id

      public ReturnItemBuilder id(String id)

      Unique identifier of the Return Item.

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

      public ReturnItemBuilder key(@Nullable String key)

      User-defined unique identifier of the Return Item.

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

      public ReturnItemBuilder quantity(Long quantity)

      Number of Line Items or Custom Line Items returned.

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

      public ReturnItemBuilder type(String type)
      set the value to the type
      Parameters:
      type - value to be set
      Returns:
      Builder
    • comment

      public ReturnItemBuilder comment(@Nullable String comment)

      User-defined description for the return.

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

      public ReturnItemBuilder shipmentState(ReturnShipmentState shipmentState)

      Shipment status of the Return Item.

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

      public ReturnItemBuilder paymentState(ReturnPaymentState paymentState)

      Payment status of the Return Item:

      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

      public ReturnItemBuilder custom(@Nullable CustomFields custom)

      Custom Fields of the Return Item.

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

      public ReturnItemBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

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

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

      public ReturnItemBuilder createdAt(ZonedDateTime createdAt)

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

      Parameters:
      createdAt - 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 Return Item.

      Returns:
      key
    • getQuantity

      public Long getQuantity()

      Number of Line Items or Custom Line Items returned.

      Returns:
      quantity
    • getType

      public String getType()
      value of type}
      Returns:
      type
    • 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:

      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 initially created.

      Returns:
      createdAt
    • build

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

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

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

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