Class MyCartDraftImpl

java.lang.Object
com.commercetools.api.models.me.MyCartDraftImpl
All Implemented Interfaces:
CustomizableDraft<MyCartDraft>, MyCartDraft, io.vrap.rmf.base.client.Draft<MyCartDraft>, io.vrap.rmf.base.client.ModelBase

public class MyCartDraftImpl extends Object implements MyCartDraft, io.vrap.rmf.base.client.ModelBase

The customerId is determined by a password flow token and automatically set on the resulting Cart. The anonymousId is determined by a token for an anonymous session and automatically set on the resulting Cart.

  • Constructor Details

    • MyCartDraftImpl

      public MyCartDraftImpl()
      create empty instance
  • Method Details

    • getCurrency

      public String getCurrency()

      Currency the Cart uses.

      Specified by:
      getCurrency in interface MyCartDraft
      Returns:
      currency
    • getCustomerEmail

      public String getCustomerEmail()

      Email address of the Customer the Cart belongs to.

      Specified by:
      getCustomerEmail in interface MyCartDraft
      Returns:
      customerEmail
    • getBusinessUnit

      public BusinessUnitResourceIdentifier getBusinessUnit()

      ResourceIdentifier to the Business Unit the Cart should belong to. The Customer must be an Associate of the Business Unit.

      Specified by:
      getBusinessUnit in interface MyCartDraft
      Returns:
      businessUnit
    • getStore

      public StoreResourceIdentifier getStore()

      ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

      Specified by:
      getStore in interface MyCartDraft
      Returns:
      store
    • getLineItems

      public List<MyLineItemDraft> getLineItems()

      Line Items to add to the Cart.

      Specified by:
      getLineItems in interface MyCartDraft
      Returns:
      lineItems
    • getTaxMode

      public TaxMode getTaxMode()

      Determines how Tax Rates are set. The Disabled TaxMode cannot be set.

      Specified by:
      getTaxMode in interface MyCartDraft
      Returns:
      taxMode
    • getInventoryMode

      public InventoryMode getInventoryMode()

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

      Specified by:
      getInventoryMode in interface MyCartDraft
      Returns:
      inventoryMode
    • getBillingAddress

      public BaseAddress getBillingAddress()

      Billing address associated with the Cart.

      Specified by:
      getBillingAddress in interface MyCartDraft
      Returns:
      billingAddress
    • getShippingAddress

      public BaseAddress getShippingAddress()

      Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

      Specified by:
      getShippingAddress in interface MyCartDraft
      Returns:
      shippingAddress
    • getShippingMethod

      public ShippingMethodResourceIdentifier getShippingMethod()

      Shipping Method for the Cart. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

      Specified by:
      getShippingMethod in interface MyCartDraft
      Returns:
      shippingMethod
    • getItemShippingAddresses

      public List<BaseAddress> getItemShippingAddresses()

      Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. The keys are used by LineItems to reference these addresses under their shippingDetails.

      Eligible Shipping Methods or applicable Tax Rates are determined by the Cart shippingAddress, and not itemShippingAddresses.

      Specified by:
      getItemShippingAddresses in interface MyCartDraft
      Returns:
      itemShippingAddresses
    • getDiscountCodes

      public List<String> getDiscountCodes()

      code of the existing DiscountCodes to add to the Cart.

      Specified by:
      getDiscountCodes in interface MyCartDraft
      Returns:
      discountCodes
    • getCountry

      public String getCountry()

      Used for LineItem Price selection. If used for Create Cart in Store, the provided country must be one of the Store's countries.

      Specified by:
      getCountry in interface MyCartDraft
      Returns:
      country
    • getLocale

      public String getLocale()

      Languages of the Cart. Can only contain languages supported by the Project.

      Specified by:
      getLocale in interface MyCartDraft
      Returns:
      locale
    • getDeleteDaysAfterLastModification

      public Long getDeleteDaysAfterLastModification()

      Number of days after which a Cart with Active CartState is deleted since its last modification. If not provided, the default value for this field configured in Project settings is assigned.

      Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.

      Specified by:
      getDeleteDaysAfterLastModification in interface MyCartDraft
      Returns:
      deleteDaysAfterLastModification
    • getCustom

      public CustomFieldsDraft getCustom()

      Custom Fields for the Cart.

      Specified by:
      getCustom in interface CustomizableDraft<MyCartDraft>
      Specified by:
      getCustom in interface MyCartDraft
      Returns:
      custom
    • setCurrency

      public void setCurrency(String currency)
      Description copied from interface: MyCartDraft

      Currency the Cart uses.

      Specified by:
      setCurrency in interface MyCartDraft
      Parameters:
      currency - value to be set
    • setCustomerEmail

      public void setCustomerEmail(String customerEmail)
      Description copied from interface: MyCartDraft

      Email address of the Customer the Cart belongs to.

      Specified by:
      setCustomerEmail in interface MyCartDraft
      Parameters:
      customerEmail - value to be set
    • setBusinessUnit

      public void setBusinessUnit(BusinessUnitResourceIdentifier businessUnit)
      Description copied from interface: MyCartDraft

      ResourceIdentifier to the Business Unit the Cart should belong to. The Customer must be an Associate of the Business Unit.

      Specified by:
      setBusinessUnit in interface MyCartDraft
      Parameters:
      businessUnit - value to be set
    • setStore

      public void setStore(StoreResourceIdentifier store)
      Description copied from interface: MyCartDraft

      ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

      Specified by:
      setStore in interface MyCartDraft
      Parameters:
      store - value to be set
    • setLineItems

      public void setLineItems(MyLineItemDraft... lineItems)
      Description copied from interface: MyCartDraft

      Line Items to add to the Cart.

      Specified by:
      setLineItems in interface MyCartDraft
      Parameters:
      lineItems - values to be set
    • setLineItems

      public void setLineItems(List<MyLineItemDraft> lineItems)
      Description copied from interface: MyCartDraft

      Line Items to add to the Cart.

      Specified by:
      setLineItems in interface MyCartDraft
      Parameters:
      lineItems - values to be set
    • setTaxMode

      public void setTaxMode(TaxMode taxMode)
      Description copied from interface: MyCartDraft

      Determines how Tax Rates are set. The Disabled TaxMode cannot be set.

      Specified by:
      setTaxMode in interface MyCartDraft
      Parameters:
      taxMode - value to be set
    • setInventoryMode

      public void setInventoryMode(InventoryMode inventoryMode)
      Description copied from interface: MyCartDraft

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

      Specified by:
      setInventoryMode in interface MyCartDraft
      Parameters:
      inventoryMode - value to be set
    • setBillingAddress

      public void setBillingAddress(BaseAddress billingAddress)
      Description copied from interface: MyCartDraft

      Billing address associated with the Cart.

      Specified by:
      setBillingAddress in interface MyCartDraft
      Parameters:
      billingAddress - value to be set
    • setShippingAddress

      public void setShippingAddress(BaseAddress shippingAddress)
      Description copied from interface: MyCartDraft

      Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

      Specified by:
      setShippingAddress in interface MyCartDraft
      Parameters:
      shippingAddress - value to be set
    • setShippingMethod

      public void setShippingMethod(ShippingMethodResourceIdentifier shippingMethod)
      Description copied from interface: MyCartDraft

      Shipping Method for the Cart. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

      Specified by:
      setShippingMethod in interface MyCartDraft
      Parameters:
      shippingMethod - value to be set
    • setItemShippingAddresses

      public void setItemShippingAddresses(BaseAddress... itemShippingAddresses)
      Description copied from interface: MyCartDraft

      Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. The keys are used by LineItems to reference these addresses under their shippingDetails.

      Eligible Shipping Methods or applicable Tax Rates are determined by the Cart shippingAddress, and not itemShippingAddresses.

      Specified by:
      setItemShippingAddresses in interface MyCartDraft
      Parameters:
      itemShippingAddresses - values to be set
    • setItemShippingAddresses

      public void setItemShippingAddresses(List<BaseAddress> itemShippingAddresses)
      Description copied from interface: MyCartDraft

      Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. The keys are used by LineItems to reference these addresses under their shippingDetails.

      Eligible Shipping Methods or applicable Tax Rates are determined by the Cart shippingAddress, and not itemShippingAddresses.

      Specified by:
      setItemShippingAddresses in interface MyCartDraft
      Parameters:
      itemShippingAddresses - values to be set
    • setDiscountCodes

      public void setDiscountCodes(String... discountCodes)
      Description copied from interface: MyCartDraft

      code of the existing DiscountCodes to add to the Cart.

      Specified by:
      setDiscountCodes in interface MyCartDraft
      Parameters:
      discountCodes - values to be set
    • setDiscountCodes

      public void setDiscountCodes(List<String> discountCodes)
      Description copied from interface: MyCartDraft

      code of the existing DiscountCodes to add to the Cart.

      Specified by:
      setDiscountCodes in interface MyCartDraft
      Parameters:
      discountCodes - values to be set
    • setCountry

      public void setCountry(String country)
      Description copied from interface: MyCartDraft

      Used for LineItem Price selection. If used for Create Cart in Store, the provided country must be one of the Store's countries.

      Specified by:
      setCountry in interface MyCartDraft
      Parameters:
      country - value to be set
    • setLocale

      public void setLocale(String locale)
      Description copied from interface: MyCartDraft

      Languages of the Cart. Can only contain languages supported by the Project.

      Specified by:
      setLocale in interface MyCartDraft
      Parameters:
      locale - value to be set
    • setDeleteDaysAfterLastModification

      public void setDeleteDaysAfterLastModification(Long deleteDaysAfterLastModification)
      Description copied from interface: MyCartDraft

      Number of days after which a Cart with Active CartState is deleted since its last modification. If not provided, the default value for this field configured in Project settings is assigned.

      Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.

      Specified by:
      setDeleteDaysAfterLastModification in interface MyCartDraft
      Parameters:
      deleteDaysAfterLastModification - value to be set
    • setCustom

      public void setCustom(CustomFieldsDraft custom)
      Description copied from interface: MyCartDraft

      Custom Fields for the Cart.

      Specified by:
      setCustom in interface CustomizableDraft<MyCartDraft>
      Specified by:
      setCustom in interface MyCartDraft
      Parameters:
      custom - value to be set
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object