Class ReturnInfoBuilder

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

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

     ReturnInfo returnInfo = ReturnInfo.builder()
             .plusItems(itemsBuilder -> itemsBuilder)
             .returnTrackingId("{returnTrackingId}")
             .returnDate("{returnDate}")
             .build()
 
  • Constructor Details

    • ReturnInfoBuilder

      public ReturnInfoBuilder()
  • Method Details

    • items

      public ReturnInfoBuilder items(ReturnItem... items)
      set values to the items
      Parameters:
      items - value to be set
      Returns:
      Builder
    • items

      public ReturnInfoBuilder items(List<ReturnItem> items)
      set value to the items
      Parameters:
      items - value to be set
      Returns:
      Builder
    • plusItems

      public ReturnInfoBuilder plusItems(ReturnItem... items)
      add values to the items
      Parameters:
      items - value to be set
      Returns:
      Builder
    • plusItems

      add the value to the items using the builder function
      Parameters:
      builder - function to build the items value
      Returns:
      Builder
    • withItems

      set the value to the items using the builder function
      Parameters:
      builder - function to build the items value
      Returns:
      Builder
    • addItems

      add the value to the items using the builder function
      Parameters:
      builder - function to build the items value
      Returns:
      Builder
    • setItems

      set the value to the items using the builder function
      Parameters:
      builder - function to build the items value
      Returns:
      Builder
    • returnTrackingId

      public ReturnInfoBuilder returnTrackingId(String returnTrackingId)

      Identifies, which return tracking ID is connected to this particular return.

      Parameters:
      returnTrackingId - value to be set
      Returns:
      Builder
    • returnDate

      public ReturnInfoBuilder returnDate(String returnDate)
      set the value to the returnDate
      Parameters:
      returnDate - value to be set
      Returns:
      Builder
    • getItems

      public List<ReturnItem> getItems()
      value of items}
      Returns:
      items
    • getReturnTrackingId

      public String getReturnTrackingId()

      Identifies, which return tracking ID is connected to this particular return.

      Returns:
      returnTrackingId
    • getReturnDate

      public String getReturnDate()
      value of returnDate}
      Returns:
      returnDate
    • build

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

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

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

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