Class OrderEditBuilder

java.lang.Object
com.commercetools.api.models.order_edit.OrderEditBuilder
All Implemented Interfaces:
Builder<OrderEdit>

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

     OrderEdit orderEdit = OrderEdit.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .resource(resourceBuilder -> resourceBuilder)
             .plusStagedActions(stagedActionsBuilder -> stagedActionsBuilder)
             .result(resultBuilder -> resultBuilder)
             .build()
 
  • Constructor Details

    • OrderEditBuilder

      public OrderEditBuilder()
  • Method Details

    • id

      public OrderEditBuilder id(String id)

      Unique identifier of the Order Edit.

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

      public OrderEditBuilder version(Long version)

      Current version of the Order Edit.

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

      public OrderEditBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the Order Edit was initially created.

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

      public OrderEditBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Order Edit was last updated.

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

      public OrderEditBuilder key(@Nullable String key)

      User-defined unique identifier of the Order Edit.

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

      Reference to the Order updated with this edit.

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

      Reference to the Order updated with this edit.

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

      public OrderEditBuilder resource(OrderReference resource)

      Reference to the Order updated with this edit.

      Parameters:
      resource - value to be set
      Returns:
      Builder
    • stagedActions

      public OrderEditBuilder stagedActions(StagedOrderUpdateAction... stagedActions)

      Update actions applied to the Order referenced by resource.

      Parameters:
      stagedActions - value to be set
      Returns:
      Builder
    • stagedActions

      public OrderEditBuilder stagedActions(List<StagedOrderUpdateAction> stagedActions)

      Update actions applied to the Order referenced by resource.

      Parameters:
      stagedActions - value to be set
      Returns:
      Builder
    • plusStagedActions

      public OrderEditBuilder plusStagedActions(StagedOrderUpdateAction... stagedActions)

      Update actions applied to the Order referenced by resource.

      Parameters:
      stagedActions - value to be set
      Returns:
      Builder
    • plusStagedActions

      Update actions applied to the Order referenced by resource.

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

      Update actions applied to the Order referenced by resource.

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

      public OrderEditBuilder result(OrderEditResult result)

      For applied edits, it's a summary of the changes on the Order. For unapplied edits, it's a preview of the changes.

      Parameters:
      result - value to be set
      Returns:
      Builder
    • result

      For applied edits, it's a summary of the changes on the Order. For unapplied edits, it's a preview of the changes.

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

      public OrderEditBuilder comment(@Nullable String comment)

      User-defined information regarding the Order Edit.

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

      Custom Fields of the Order Edit.

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

      Custom Fields of the Order Edit.

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

      public OrderEditBuilder custom(@Nullable CustomFields custom)

      Custom Fields of the Order Edit.

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

      IDs and references that last modified the OrderEdit.

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

      public OrderEditBuilder withLastModifiedBy(Function<LastModifiedByBuilder,LastModifiedBy> builder)

      IDs and references that last modified the OrderEdit.

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

      public OrderEditBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the OrderEdit.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      IDs and references that created the OrderEdit.

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

      public OrderEditBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      IDs and references that created the OrderEdit.

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

      public OrderEditBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the OrderEdit.

      Parameters:
      createdBy - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the Order Edit.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the Order Edit.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the Order Edit was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Order Edit was last updated.

      Returns:
      lastModifiedAt
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier of the Order Edit.

      Returns:
      key
    • getResource

      public OrderReference getResource()

      Reference to the Order updated with this edit.

      Returns:
      resource
    • getStagedActions

      public List<StagedOrderUpdateAction> getStagedActions()

      Update actions applied to the Order referenced by resource.

      Returns:
      stagedActions
    • getResult

      public OrderEditResult getResult()

      For applied edits, it's a summary of the changes on the Order. For unapplied edits, it's a preview of the changes.

      Returns:
      result
    • getComment

      @Nullable public String getComment()

      User-defined information regarding the Order Edit.

      Returns:
      comment
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields of the Order Edit.

      Returns:
      custom
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the OrderEdit.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the OrderEdit.

      Returns:
      createdBy
    • build

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

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

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

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