Class OrderImportDraftBuilder

java.lang.Object
com.commercetools.api.models.order.OrderImportDraftBuilder
All Implemented Interfaces:
Builder<OrderImportDraft>

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

     OrderImportDraft orderImportDraft = OrderImportDraft.builder()
             .totalPrice(totalPriceBuilder -> totalPriceBuilder)
             .build()
 
  • Constructor Details

    • OrderImportDraftBuilder

      public OrderImportDraftBuilder()
  • Method Details

    • orderNumber

      public OrderImportDraftBuilder orderNumber(@Nullable String orderNumber)

      User-defined identifier of the Order. Must be unique across a Project. Once set, the value cannot be changed.

      Parameters:
      orderNumber - value to be set
      Returns:
      Builder
    • purchaseOrderNumber

      public OrderImportDraftBuilder purchaseOrderNumber(@Nullable String purchaseOrderNumber)

      User-defined identifier for a purchase Order.

      Parameters:
      purchaseOrderNumber - value to be set
      Returns:
      Builder
    • customerId

      public OrderImportDraftBuilder customerId(@Nullable String customerId)

      The id of the Customer the Order belongs to.

      Parameters:
      customerId - value to be set
      Returns:
      Builder
    • customerEmail

      public OrderImportDraftBuilder customerEmail(@Nullable String customerEmail)

      The Email address of the Customer the Order belongs to. Can be used instead of customerId when no check against existing Customers is required.

      Parameters:
      customerEmail - value to be set
      Returns:
      Builder
    • customerGroup

      The Customer Group of the Customer the Order belongs to.

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

      The Customer Group of the Customer the Order belongs to.

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

      public OrderImportDraftBuilder customerGroup(@Nullable CustomerGroupResourceIdentifier customerGroup)

      The Customer Group of the Customer the Order belongs to.

      Parameters:
      customerGroup - value to be set
      Returns:
      Builder
    • businessUnit

      ResourceIdentifier to the Business Unit the Order should belong to. When the customerId of the Order is also set, the Customer must be an Associate of the Business Unit. Only available for B2B-enabled Projects.

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

      ResourceIdentifier to the Business Unit the Order should belong to. When the customerId of the Order is also set, the Customer must be an Associate of the Business Unit. Only available for B2B-enabled Projects.

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

      public OrderImportDraftBuilder businessUnit(@Nullable BusinessUnitResourceIdentifier businessUnit)

      ResourceIdentifier to the Business Unit the Order should belong to. When the customerId of the Order is also set, the Customer must be an Associate of the Business Unit. Only available for B2B-enabled Projects.

      Parameters:
      businessUnit - value to be set
      Returns:
      Builder
    • store

      The Store the Order belongs to. Used for filtering.

      If a LineItemImportDraft or a CustomLineItemImportDraft specifies a distributionChannel or a supplyChannel that is not defined for the referenced Store, the Order Import gets rejected. The same applies when the provided country is not defined for the referenced Store.

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

      The Store the Order belongs to. Used for filtering.

      If a LineItemImportDraft or a CustomLineItemImportDraft specifies a distributionChannel or a supplyChannel that is not defined for the referenced Store, the Order Import gets rejected. The same applies when the provided country is not defined for the referenced Store.

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

      public OrderImportDraftBuilder store(@Nullable StoreResourceIdentifier store)

      The Store the Order belongs to. Used for filtering.

      If a LineItemImportDraft or a CustomLineItemImportDraft specifies a distributionChannel or a supplyChannel that is not defined for the referenced Store, the Order Import gets rejected. The same applies when the provided country is not defined for the referenced Store.

      Parameters:
      store - value to be set
      Returns:
      Builder
    • lineItems

      public OrderImportDraftBuilder lineItems(@Nullable LineItemImportDraft... lineItems)

      Line Items to add to the Order.

      If not specified, customLineItems must not be empty.

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

      public OrderImportDraftBuilder lineItems(@Nullable List<LineItemImportDraft> lineItems)

      Line Items to add to the Order.

      If not specified, customLineItems must not be empty.

      Parameters:
      lineItems - value to be set
      Returns:
      Builder
    • plusLineItems

      public OrderImportDraftBuilder plusLineItems(@Nullable LineItemImportDraft... lineItems)

      Line Items to add to the Order.

      If not specified, customLineItems must not be empty.

      Parameters:
      lineItems - value to be set
      Returns:
      Builder
    • plusLineItems

      Line Items to add to the Order.

      If not specified, customLineItems must not be empty.

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

      Line Items to add to the Order.

      If not specified, customLineItems must not be empty.

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

      Line Items to add to the Order.

      If not specified, customLineItems must not be empty.

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

      Line Items to add to the Order.

      If not specified, customLineItems must not be empty.

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

      public OrderImportDraftBuilder customLineItems(@Nullable CustomLineItemImportDraft... customLineItems)

      Custom Line Items to add to the Cart.

      If not specified, lineItems must not be empty.

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

      public OrderImportDraftBuilder customLineItems(@Nullable List<CustomLineItemImportDraft> customLineItems)

      Custom Line Items to add to the Cart.

      If not specified, lineItems must not be empty.

      Parameters:
      customLineItems - value to be set
      Returns:
      Builder
    • plusCustomLineItems

      public OrderImportDraftBuilder plusCustomLineItems(@Nullable CustomLineItemImportDraft... customLineItems)

      Custom Line Items to add to the Cart.

      If not specified, lineItems must not be empty.

      Parameters:
      customLineItems - value to be set
      Returns:
      Builder
    • plusCustomLineItems

      Custom Line Items to add to the Cart.

      If not specified, lineItems must not be empty.

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

      Custom Line Items to add to the Cart.

      If not specified, lineItems must not be empty.

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

      Custom Line Items to add to the Cart.

      If not specified, lineItems must not be empty.

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

      Custom Line Items to add to the Cart.

      If not specified, lineItems must not be empty.

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

      The total Price of the Order. The amount can be negative.

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

      public OrderImportDraftBuilder withTotalPrice(Function<MoneyBuilder,Money> builder)

      The total Price of the Order. The amount can be negative.

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

      public OrderImportDraftBuilder totalPrice(Money totalPrice)

      The total Price of the Order. The amount can be negative.

      Parameters:
      totalPrice - value to be set
      Returns:
      Builder
    • taxedPrice

      Include TaxedPrice information for the Order. If not included, and if you have Tax Rates set for Line Items and Custom Line Items, the Order total will not be recalculated.

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

      Include TaxedPrice information for the Order. If not included, and if you have Tax Rates set for Line Items and Custom Line Items, the Order total will not be recalculated.

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

      public OrderImportDraftBuilder taxedPrice(@Nullable TaxedPriceDraft taxedPrice)

      Include TaxedPrice information for the Order. If not included, and if you have Tax Rates set for Line Items and Custom Line Items, the Order total will not be recalculated.

      Parameters:
      taxedPrice - value to be set
      Returns:
      Builder
    • taxRoundingMode

      public OrderImportDraftBuilder taxRoundingMode(@Nullable RoundingMode taxRoundingMode)

      Determines how monetary values are rounded when calculating taxes for taxedPrice.

      Parameters:
      taxRoundingMode - value to be set
      Returns:
      Builder
    • taxCalculationMode

      public OrderImportDraftBuilder taxCalculationMode(@Nullable TaxCalculationMode taxCalculationMode)

      Determines how taxes are calculated for taxedPrice.

      Parameters:
      taxCalculationMode - value to be set
      Returns:
      Builder
    • inventoryMode

      public OrderImportDraftBuilder inventoryMode(@Nullable InventoryMode inventoryMode)

      Determines how stock quantities are tracked for Line Items in the Cart.

      Parameters:
      inventoryMode - value to be set
      Returns:
      Builder
    • billingAddress

      Billing address associated with the Order.

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

      public OrderImportDraftBuilder withBillingAddress(Function<BaseAddressBuilder,BaseAddress> builder)

      Billing address associated with the Order.

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

      public OrderImportDraftBuilder billingAddress(@Nullable BaseAddress billingAddress)

      Billing address associated with the Order.

      Parameters:
      billingAddress - value to be set
      Returns:
      Builder
    • shippingAddress

      Shipping address associated with the Order.

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

      public OrderImportDraftBuilder withShippingAddress(Function<BaseAddressBuilder,BaseAddress> builder)

      Shipping address associated with the Order.

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

      public OrderImportDraftBuilder shippingAddress(@Nullable BaseAddress shippingAddress)

      Shipping address associated with the Order.

      Parameters:
      shippingAddress - value to be set
      Returns:
      Builder
    • itemShippingAddresses

      public OrderImportDraftBuilder itemShippingAddresses(@Nullable BaseAddress... itemShippingAddresses)

      Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

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

      public OrderImportDraftBuilder itemShippingAddresses(@Nullable List<BaseAddress> itemShippingAddresses)

      Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

      Parameters:
      itemShippingAddresses - value to be set
      Returns:
      Builder
    • plusItemShippingAddresses

      public OrderImportDraftBuilder plusItemShippingAddresses(@Nullable BaseAddress... itemShippingAddresses)

      Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

      Parameters:
      itemShippingAddresses - value to be set
      Returns:
      Builder
    • plusItemShippingAddresses

      public OrderImportDraftBuilder plusItemShippingAddresses(Function<BaseAddressBuilder,BaseAddressBuilder> builder)

      Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

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

      public OrderImportDraftBuilder withItemShippingAddresses(Function<BaseAddressBuilder,BaseAddressBuilder> builder)

      Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

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

      public OrderImportDraftBuilder addItemShippingAddresses(Function<BaseAddressBuilder,BaseAddress> builder)

      Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

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

      public OrderImportDraftBuilder setItemShippingAddresses(Function<BaseAddressBuilder,BaseAddress> builder)

      Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

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

      Shipping-related information of the Order.

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

      Shipping-related information of the Order.

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

      public OrderImportDraftBuilder shippingInfo(@Nullable ShippingInfoImportDraft shippingInfo)

      Shipping-related information of the Order.

      Parameters:
      shippingInfo - value to be set
      Returns:
      Builder
    • paymentInfo

      Payment information associated with the Order.

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

      Payment information associated with the Order.

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

      public OrderImportDraftBuilder paymentInfo(@Nullable PaymentInfo paymentInfo)

      Payment information associated with the Order.

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

      public OrderImportDraftBuilder paymentState(@Nullable PaymentState paymentState)

      Payment status of the Order.

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

      public OrderImportDraftBuilder shipmentState(@Nullable ShipmentState shipmentState)

      Shipment status of the Order.

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

      public OrderImportDraftBuilder orderState(@Nullable OrderState orderState)

      Current status of the Order.

      Parameters:
      orderState - value to be set
      Returns:
      Builder
    • state

      State of the Order in a custom workflow.

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

      State of the Order in a custom workflow.

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

      public OrderImportDraftBuilder state(@Nullable StateReference state)

      State of the Order in a custom workflow.

      Parameters:
      state - value to be set
      Returns:
      Builder
    • country

      public OrderImportDraftBuilder country(@Nullable String country)

      Include a value to associate a country with the Order.

      Parameters:
      country - value to be set
      Returns:
      Builder
    • origin

      public OrderImportDraftBuilder origin(@Nullable CartOrigin origin)

      Indicates the origin of the Order.

      Parameters:
      origin - value to be set
      Returns:
      Builder
    • completedAt

      public OrderImportDraftBuilder completedAt(@Nullable ZonedDateTime completedAt)

      User-defined date and time for the Order. This value does not influence the createdAt or lastModifiedAt values of the Order created by the Order Import.

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

      Custom Fields for the Order.

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

      Custom Fields for the Order.

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

      public OrderImportDraftBuilder custom(@Nullable CustomFieldsDraft custom)

      Custom Fields for the Order.

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

      @Nullable public String getOrderNumber()

      User-defined identifier of the Order. Must be unique across a Project. Once set, the value cannot be changed.

      Returns:
      orderNumber
    • getPurchaseOrderNumber

      @Nullable public String getPurchaseOrderNumber()

      User-defined identifier for a purchase Order.

      Returns:
      purchaseOrderNumber
    • getCustomerId

      @Nullable public String getCustomerId()

      The id of the Customer the Order belongs to.

      Returns:
      customerId
    • getCustomerEmail

      @Nullable public String getCustomerEmail()

      The Email address of the Customer the Order belongs to. Can be used instead of customerId when no check against existing Customers is required.

      Returns:
      customerEmail
    • getCustomerGroup

      @Nullable public CustomerGroupResourceIdentifier getCustomerGroup()

      The Customer Group of the Customer the Order belongs to.

      Returns:
      customerGroup
    • getBusinessUnit

      @Nullable public BusinessUnitResourceIdentifier getBusinessUnit()

      ResourceIdentifier to the Business Unit the Order should belong to. When the customerId of the Order is also set, the Customer must be an Associate of the Business Unit. Only available for B2B-enabled Projects.

      Returns:
      businessUnit
    • getStore

      @Nullable public StoreResourceIdentifier getStore()

      The Store the Order belongs to. Used for filtering.

      If a LineItemImportDraft or a CustomLineItemImportDraft specifies a distributionChannel or a supplyChannel that is not defined for the referenced Store, the Order Import gets rejected. The same applies when the provided country is not defined for the referenced Store.

      Returns:
      store
    • getLineItems

      @Nullable public List<LineItemImportDraft> getLineItems()

      Line Items to add to the Order.

      If not specified, customLineItems must not be empty.

      Returns:
      lineItems
    • getCustomLineItems

      @Nullable public List<CustomLineItemImportDraft> getCustomLineItems()

      Custom Line Items to add to the Cart.

      If not specified, lineItems must not be empty.

      Returns:
      customLineItems
    • getTotalPrice

      public Money getTotalPrice()

      The total Price of the Order. The amount can be negative.

      Returns:
      totalPrice
    • getTaxedPrice

      @Nullable public TaxedPriceDraft getTaxedPrice()

      Include TaxedPrice information for the Order. If not included, and if you have Tax Rates set for Line Items and Custom Line Items, the Order total will not be recalculated.

      Returns:
      taxedPrice
    • getTaxRoundingMode

      @Nullable public RoundingMode getTaxRoundingMode()

      Determines how monetary values are rounded when calculating taxes for taxedPrice.

      Returns:
      taxRoundingMode
    • getTaxCalculationMode

      @Nullable public TaxCalculationMode getTaxCalculationMode()

      Determines how taxes are calculated for taxedPrice.

      Returns:
      taxCalculationMode
    • getInventoryMode

      @Nullable public InventoryMode getInventoryMode()

      Determines how stock quantities are tracked for Line Items in the Cart.

      Returns:
      inventoryMode
    • getBillingAddress

      @Nullable public BaseAddress getBillingAddress()

      Billing address associated with the Order.

      Returns:
      billingAddress
    • getShippingAddress

      @Nullable public BaseAddress getShippingAddress()

      Shipping address associated with the Order.

      Returns:
      shippingAddress
    • getItemShippingAddresses

      @Nullable public List<BaseAddress> getItemShippingAddresses()

      Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

      Returns:
      itemShippingAddresses
    • getShippingInfo

      @Nullable public ShippingInfoImportDraft getShippingInfo()

      Shipping-related information of the Order.

      Returns:
      shippingInfo
    • getPaymentInfo

      @Nullable public PaymentInfo getPaymentInfo()

      Payment information associated with the Order.

      Returns:
      paymentInfo
    • getPaymentState

      @Nullable public PaymentState getPaymentState()

      Payment status of the Order.

      Returns:
      paymentState
    • getShipmentState

      @Nullable public ShipmentState getShipmentState()

      Shipment status of the Order.

      Returns:
      shipmentState
    • getOrderState

      @Nullable public OrderState getOrderState()

      Current status of the Order.

      Returns:
      orderState
    • getState

      @Nullable public StateReference getState()

      State of the Order in a custom workflow.

      Returns:
      state
    • getCountry

      @Nullable public String getCountry()

      Include a value to associate a country with the Order.

      Returns:
      country
    • getOrigin

      @Nullable public CartOrigin getOrigin()

      Indicates the origin of the Order.

      Returns:
      origin
    • getCompletedAt

      @Nullable public ZonedDateTime getCompletedAt()

      User-defined date and time for the Order. This value does not influence the createdAt or lastModifiedAt values of the Order created by the Order Import.

      Returns:
      completedAt
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields for the Order.

      Returns:
      custom
    • build

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

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

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

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