Class OrderEditDraftBuilder

java.lang.Object
com.commercetools.api.models.order_edit.OrderEditDraftBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<OrderEditDraft>

public class OrderEditDraftBuilder extends Object implements io.vrap.rmf.base.client.Builder<OrderEditDraft>
OrderEditDraftBuilder
Example to create an instance using the builder pattern

     OrderEditDraft orderEditDraft = OrderEditDraft.builder()
             .resource(resourceBuilder -> resourceBuilder)
             .build()
 
  • Constructor Details

    • OrderEditDraftBuilder

      public OrderEditDraftBuilder()
  • Method Details

    • key

      User-defined unique identifier for 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 OrderEditDraftBuilder resource(OrderReference resource)

      Reference to the Order updated with this edit.

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

      public OrderEditDraftBuilder stagedActions(@Nullable StagedOrderUpdateAction... stagedActions)

      Update actions to apply to the Order referenced in resource. Cannot be updated if the edit has been applied.

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

      public OrderEditDraftBuilder stagedActions(@Nullable List<StagedOrderUpdateAction> stagedActions)

      Update actions to apply to the Order referenced in resource. Cannot be updated if the edit has been applied.

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

      public OrderEditDraftBuilder plusStagedActions(@Nullable StagedOrderUpdateAction... stagedActions)

      Update actions to apply to the Order referenced in resource. Cannot be updated if the edit has been applied.

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

      public OrderEditDraftBuilder plusStagedActions(Function<StagedOrderUpdateActionBuilder,io.vrap.rmf.base.client.Builder<? extends StagedOrderUpdateAction>> builder)

      Update actions to apply to the Order referenced in resource. Cannot be updated if the edit has been applied.

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

      public OrderEditDraftBuilder withStagedActions(Function<StagedOrderUpdateActionBuilder,io.vrap.rmf.base.client.Builder<? extends StagedOrderUpdateAction>> builder)

      Update actions to apply to the Order referenced in resource. Cannot be updated if the edit has been applied.

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

      Custom Fields for the Order Edit.

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

      Custom Fields for the Order Edit.

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

      Custom Fields for the Order Edit.

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

      public OrderEditDraftBuilder comment(@Nullable String comment)

      User-defined description regarding the Order Edit.

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

      public OrderEditDraftBuilder dryRun(@Nullable Boolean dryRun)

      Set to true if you want to peview the edited Order first without persisting it (dry run). A dry run allows checking for potential errors when trying to apply the stagedActions.

      Order API Extensions, if any, are also called in dry runs.

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

      @Nullable public String getKey()

      User-defined unique identifier for the Order Edit.

      Returns:
      key
    • getResource

      public OrderReference getResource()

      Reference to the Order updated with this edit.

      Returns:
      resource
    • getStagedActions

      @Nullable public List<StagedOrderUpdateAction> getStagedActions()

      Update actions to apply to the Order referenced in resource. Cannot be updated if the edit has been applied.

      Returns:
      stagedActions
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields for the Order Edit.

      Returns:
      custom
    • getComment

      @Nullable public String getComment()

      User-defined description regarding the Order Edit.

      Returns:
      comment
    • getDryRun

      @Nullable public Boolean getDryRun()

      Set to true if you want to peview the edited Order first without persisting it (dry run). A dry run allows checking for potential errors when trying to apply the stagedActions.

      Order API Extensions, if any, are also called in dry runs.

      Returns:
      dryRun
    • build

      public OrderEditDraft build()
      builds OrderEditDraft with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<OrderEditDraft>
      Returns:
      OrderEditDraft
    • buildUnchecked

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

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

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