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(1)
             .type("{type}")
             .comment("{comment}")
             .shipmentState(ReturnShipmentState.ADVISED)
             .paymentState(ReturnPaymentState.NON_REFUNDABLE)
             .lastModifiedAt("{lastModifiedAt}")
             .createdAt("{createdAt}")
             .build()
 
  • Constructor Details

    • ReturnItemBuilder

      public ReturnItemBuilder()
  • Method Details

    • id

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

      public ReturnItemBuilder quantity(Integer quantity)
      set the value to the quantity
      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(String comment)
      set the value to the comment
      Parameters:
      comment - value to be set
      Returns:
      Builder
    • shipmentState

      public ReturnItemBuilder shipmentState(ReturnShipmentState shipmentState)
      set the value to the shipmentState
      Parameters:
      shipmentState - value to be set
      Returns:
      Builder
    • paymentState

      public ReturnItemBuilder paymentState(ReturnPaymentState paymentState)
      set the value to the paymentState
      Parameters:
      paymentState - value to be set
      Returns:
      Builder
    • lastModifiedAt

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

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

      public String getId()
      value of id}
      Returns:
      id
    • getQuantity

      public Integer getQuantity()
      value of quantity}
      Returns:
      quantity
    • getType

      public String getType()
      value of type}
      Returns:
      type
    • getComment

      public String getComment()
      value of comment}
      Returns:
      comment
    • getShipmentState

      public ReturnShipmentState getShipmentState()
      value of shipmentState}
      Returns:
      shipmentState
    • getPaymentState

      public ReturnPaymentState getPaymentState()
      value of paymentState}
      Returns:
      paymentState
    • getLastModifiedAt

      public String getLastModifiedAt()
      value of lastModifiedAt}
      Returns:
      lastModifiedAt
    • getCreatedAt

      public String getCreatedAt()
      value of createdAt}
      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