Class BusinessUnitDraftImpl

java.lang.Object
com.commercetools.api.models.business_unit.BusinessUnitDraftImpl
All Implemented Interfaces:
BusinessUnitDraft, WithKey, io.vrap.rmf.base.client.ModelBase

public class BusinessUnitDraftImpl extends Object implements BusinessUnitDraft, io.vrap.rmf.base.client.ModelBase

Generic draft type to model those fields all Business Units have in common. The additional fields required for creating a Company or Division are represented on CompanyDraft and DivisionDraft.

  • Constructor Details

    • BusinessUnitDraftImpl

      public BusinessUnitDraftImpl()
      create empty instance
  • Method Details

    • getKey

      public String getKey()

      User-defined unique identifier for the Business Unit.

      Specified by:
      getKey in interface BusinessUnitDraft
      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getStatus

      public BusinessUnitStatus getStatus()

      Indicates whether the Business Unit can be edited and used in Orders.

      Specified by:
      getStatus in interface BusinessUnitDraft
      Returns:
      status
    • getStores

      public List<StoreResourceIdentifier> getStores()

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

      Specified by:
      getStores in interface BusinessUnitDraft
      Returns:
      stores
    • getStoreMode

      public BusinessUnitStoreMode getStoreMode()

      Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent. storeMode is always Explicit for Companies and defaults to FromParent for Divisions.

      Specified by:
      getStoreMode in interface BusinessUnitDraft
      Returns:
      storeMode
    • getUnitType

      public BusinessUnitType getUnitType()

      Type of the Business Unit indicating its position in a hierarchy.

      Specified by:
      getUnitType in interface BusinessUnitDraft
      Returns:
      unitType
    • getName

      public String getName()

      Name of the Business Unit.

      Specified by:
      getName in interface BusinessUnitDraft
      Returns:
      name
    • getContactEmail

      public String getContactEmail()

      Email address of the Business Unit.

      Specified by:
      getContactEmail in interface BusinessUnitDraft
      Returns:
      contactEmail
    • getAssociateMode

      public BusinessUnitAssociateMode getAssociateMode()

      Determines whether the Business Unit can inherit Associates from a parent. Always Explicit for Companies and defaults to ExplicitAndFromParent for Divisions.

      Specified by:
      getAssociateMode in interface BusinessUnitDraft
      Returns:
      associateMode
    • getAssociates

      public List<AssociateDraft> getAssociates()

      List of members that are part of the Business Unit in specific roles.

      Specified by:
      getAssociates in interface BusinessUnitDraft
      Returns:
      associates
    • getAddresses

      public List<BaseAddress> getAddresses()

      Addresses used by the Business Unit.

      Specified by:
      getAddresses in interface BusinessUnitDraft
      Returns:
      addresses
    • getShippingAddresses

      public List<Integer> getShippingAddresses()

      Indexes of entries in addresses to set as shipping addresses. The shippingAddressIds of the Customer will be replaced by these addresses.

      Specified by:
      getShippingAddresses in interface BusinessUnitDraft
      Returns:
      shippingAddresses
    • getDefaultShippingAddress

      public Integer getDefaultShippingAddress()

      Index of the entry in addresses to set as the default shipping address.

      Specified by:
      getDefaultShippingAddress in interface BusinessUnitDraft
      Returns:
      defaultShippingAddress
    • getBillingAddresses

      public List<Integer> getBillingAddresses()

      Indexes of entries in addresses to set as billing addresses. The billingAddressIds of the Customer will be replaced by these addresses.

      Specified by:
      getBillingAddresses in interface BusinessUnitDraft
      Returns:
      billingAddresses
    • getDefaultBillingAddress

      public Integer getDefaultBillingAddress()

      Index of the entry in addresses to set as the default billing address.

      Specified by:
      getDefaultBillingAddress in interface BusinessUnitDraft
      Returns:
      defaultBillingAddress
    • getCustom

      public CustomFieldsDraft getCustom()

      Custom Fields for the Business Unit.

      Specified by:
      getCustom in interface BusinessUnitDraft
      Returns:
      custom
    • setKey

      public void setKey(String key)
      Description copied from interface: BusinessUnitDraft

      User-defined unique identifier for the Business Unit.

      Specified by:
      setKey in interface BusinessUnitDraft
      Parameters:
      key - value to be set
    • setStatus

      public void setStatus(BusinessUnitStatus status)
      Description copied from interface: BusinessUnitDraft

      Indicates whether the Business Unit can be edited and used in Orders.

      Specified by:
      setStatus in interface BusinessUnitDraft
      Parameters:
      status - value to be set
    • setStores

      public void setStores(StoreResourceIdentifier... stores)
      Description copied from interface: BusinessUnitDraft

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

      Specified by:
      setStores in interface BusinessUnitDraft
      Parameters:
      stores - values to be set
    • setStores

      public void setStores(List<StoreResourceIdentifier> stores)
      Description copied from interface: BusinessUnitDraft

      Sets the Stores the Business Unit is associated with. Can only be set when storeMode is Explicit. Defaults to empty for Companies and not set for Divisions.

      If the Business Unit has Stores defined, then all of its Carts, Orders, Quotes, or Quote Requests must belong to one of the Business Unit's Stores.

      If the Business Unit has no Stores, then all of its Carts, Orders, Quotes, or Quote Requests must not belong to any Store.

      Specified by:
      setStores in interface BusinessUnitDraft
      Parameters:
      stores - values to be set
    • setStoreMode

      public void setStoreMode(BusinessUnitStoreMode storeMode)
      Description copied from interface: BusinessUnitDraft

      Defines whether the Stores of the Business Unit are set directly on the Business Unit or are inherited from a parent. storeMode is always Explicit for Companies and defaults to FromParent for Divisions.

      Specified by:
      setStoreMode in interface BusinessUnitDraft
      Parameters:
      storeMode - value to be set
    • setName

      public void setName(String name)
      Description copied from interface: BusinessUnitDraft

      Name of the Business Unit.

      Specified by:
      setName in interface BusinessUnitDraft
      Parameters:
      name - value to be set
    • setContactEmail

      public void setContactEmail(String contactEmail)
      Description copied from interface: BusinessUnitDraft

      Email address of the Business Unit.

      Specified by:
      setContactEmail in interface BusinessUnitDraft
      Parameters:
      contactEmail - value to be set
    • setAssociateMode

      public void setAssociateMode(BusinessUnitAssociateMode associateMode)
      Description copied from interface: BusinessUnitDraft

      Determines whether the Business Unit can inherit Associates from a parent. Always Explicit for Companies and defaults to ExplicitAndFromParent for Divisions.

      Specified by:
      setAssociateMode in interface BusinessUnitDraft
      Parameters:
      associateMode - value to be set
    • setAssociates

      public void setAssociates(AssociateDraft... associates)
      Description copied from interface: BusinessUnitDraft

      List of members that are part of the Business Unit in specific roles.

      Specified by:
      setAssociates in interface BusinessUnitDraft
      Parameters:
      associates - values to be set
    • setAssociates

      public void setAssociates(List<AssociateDraft> associates)
      Description copied from interface: BusinessUnitDraft

      List of members that are part of the Business Unit in specific roles.

      Specified by:
      setAssociates in interface BusinessUnitDraft
      Parameters:
      associates - values to be set
    • setAddresses

      public void setAddresses(BaseAddress... addresses)
      Description copied from interface: BusinessUnitDraft

      Addresses used by the Business Unit.

      Specified by:
      setAddresses in interface BusinessUnitDraft
      Parameters:
      addresses - values to be set
    • setAddresses

      public void setAddresses(List<BaseAddress> addresses)
      Description copied from interface: BusinessUnitDraft

      Addresses used by the Business Unit.

      Specified by:
      setAddresses in interface BusinessUnitDraft
      Parameters:
      addresses - values to be set
    • setShippingAddresses

      public void setShippingAddresses(Integer... shippingAddresses)
      Description copied from interface: BusinessUnitDraft

      Indexes of entries in addresses to set as shipping addresses. The shippingAddressIds of the Customer will be replaced by these addresses.

      Specified by:
      setShippingAddresses in interface BusinessUnitDraft
      Parameters:
      shippingAddresses - values to be set
    • setShippingAddresses

      public void setShippingAddresses(List<Integer> shippingAddresses)
      Description copied from interface: BusinessUnitDraft

      Indexes of entries in addresses to set as shipping addresses. The shippingAddressIds of the Customer will be replaced by these addresses.

      Specified by:
      setShippingAddresses in interface BusinessUnitDraft
      Parameters:
      shippingAddresses - values to be set
    • setDefaultShippingAddress

      public void setDefaultShippingAddress(Integer defaultShippingAddress)
      Description copied from interface: BusinessUnitDraft

      Index of the entry in addresses to set as the default shipping address.

      Specified by:
      setDefaultShippingAddress in interface BusinessUnitDraft
      Parameters:
      defaultShippingAddress - value to be set
    • setBillingAddresses

      public void setBillingAddresses(Integer... billingAddresses)
      Description copied from interface: BusinessUnitDraft

      Indexes of entries in addresses to set as billing addresses. The billingAddressIds of the Customer will be replaced by these addresses.

      Specified by:
      setBillingAddresses in interface BusinessUnitDraft
      Parameters:
      billingAddresses - values to be set
    • setBillingAddresses

      public void setBillingAddresses(List<Integer> billingAddresses)
      Description copied from interface: BusinessUnitDraft

      Indexes of entries in addresses to set as billing addresses. The billingAddressIds of the Customer will be replaced by these addresses.

      Specified by:
      setBillingAddresses in interface BusinessUnitDraft
      Parameters:
      billingAddresses - values to be set
    • setDefaultBillingAddress

      public void setDefaultBillingAddress(Integer defaultBillingAddress)
      Description copied from interface: BusinessUnitDraft

      Index of the entry in addresses to set as the default billing address.

      Specified by:
      setDefaultBillingAddress in interface BusinessUnitDraft
      Parameters:
      defaultBillingAddress - value to be set
    • setCustom

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

      Custom Fields for the Business Unit.

      Specified by:
      setCustom in interface BusinessUnitDraft
      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