Interface BaseAddress

All Superinterfaces:
BaseAddressMixin, WithKey
All Known Subinterfaces:
Address, AddressDraft

public interface BaseAddress extends WithKey, BaseAddressMixin

Polymorphic base type that represents a postal address and contact details. Depending on the read or write action, it can be either Address or AddressDraft that only differ in the data type for the optional custom field.


Example to create an instance using the builder pattern

     BaseAddress baseAddress = BaseAddress.builder()
             .country("{country}")
             .build()
 
  • Method Details

    • getId

      String getId()

      Unique identifier of the Address.

      It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. Use key instead and omit this field from the request to let the API generate the ID for the Address.

      Returns:
      id
    • getKey

      String getKey()

      User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and itemShippingAddresses (LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.

      Specified by:
      getKey in interface BaseAddressMixin
      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getCountry

      @NotNull @NotNull String getCountry()

      Name of the country.

      Specified by:
      getCountry in interface BaseAddressMixin
      Returns:
      country
    • getTitle

      String getTitle()

      Title of the contact, for example 'Dr.'

      Specified by:
      getTitle in interface BaseAddressMixin
      Returns:
      title
    • getSalutation

      String getSalutation()

      Salutation of the contact, for example 'Mr.' or 'Ms.'

      Specified by:
      getSalutation in interface BaseAddressMixin
      Returns:
      salutation
    • getFirstName

      String getFirstName()

      Given name (first name) of the contact.

      Specified by:
      getFirstName in interface BaseAddressMixin
      Returns:
      firstName
    • getLastName

      String getLastName()

      Family name (last name) of the contact.

      Specified by:
      getLastName in interface BaseAddressMixin
      Returns:
      lastName
    • getStreetName

      String getStreetName()

      Name of the street.

      Specified by:
      getStreetName in interface BaseAddressMixin
      Returns:
      streetName
    • getStreetNumber

      String getStreetNumber()

      Street number.

      Specified by:
      getStreetNumber in interface BaseAddressMixin
      Returns:
      streetNumber
    • getAdditionalStreetInfo

      String getAdditionalStreetInfo()

      Further information on the street address.

      Specified by:
      getAdditionalStreetInfo in interface BaseAddressMixin
      Returns:
      additionalStreetInfo
    • getPostalCode

      String getPostalCode()

      Postal code.

      Specified by:
      getPostalCode in interface BaseAddressMixin
      Returns:
      postalCode
    • getCity

      String getCity()

      Name of the city.

      Specified by:
      getCity in interface BaseAddressMixin
      Returns:
      city
    • getRegion

      String getRegion()

      Name of the region.

      Specified by:
      getRegion in interface BaseAddressMixin
      Returns:
      region
    • getState

      String getState()

      Name of the state, for example, Colorado.

      Specified by:
      getState in interface BaseAddressMixin
      Returns:
      state
    • getCompany

      String getCompany()

      Name of the company.

      Specified by:
      getCompany in interface BaseAddressMixin
      Returns:
      company
    • getDepartment

      String getDepartment()

      Name of the department.

      Specified by:
      getDepartment in interface BaseAddressMixin
      Returns:
      department
    • getBuilding

      String getBuilding()

      Number or name of the building.

      Specified by:
      getBuilding in interface BaseAddressMixin
      Returns:
      building
    • getApartment

      String getApartment()

      Number or name of the apartment.

      Specified by:
      getApartment in interface BaseAddressMixin
      Returns:
      apartment
    • getPOBox

      String getPOBox()

      Post office box number.

      Specified by:
      getPOBox in interface BaseAddressMixin
      Returns:
      pOBox
    • getPhone

      String getPhone()

      Phone number of the contact.

      Specified by:
      getPhone in interface BaseAddressMixin
      Returns:
      phone
    • getMobile

      String getMobile()

      Mobile phone number of the contact.

      Specified by:
      getMobile in interface BaseAddressMixin
      Returns:
      mobile
    • getEmail

      String getEmail()

      Email address of the contact.

      Specified by:
      getEmail in interface BaseAddressMixin
      Returns:
      email
    • getFax

      String getFax()

      Fax number of the contact.

      Specified by:
      getFax in interface BaseAddressMixin
      Returns:
      fax
    • getAdditionalAddressInfo

      String getAdditionalAddressInfo()

      Further information on the Address.

      Specified by:
      getAdditionalAddressInfo in interface BaseAddressMixin
      Returns:
      additionalAddressInfo
    • getExternalId

      String getExternalId()

      ID for the contact used in an external system.

      Specified by:
      getExternalId in interface BaseAddressMixin
      Returns:
      externalId
    • setId

      void setId(String id)

      Unique identifier of the Address.

      It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. Use key instead and omit this field from the request to let the API generate the ID for the Address.

      Parameters:
      id - value to be set
    • setKey

      void setKey(String key)

      User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and itemShippingAddresses (LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.

      Parameters:
      key - value to be set
    • setCountry

      void setCountry(String country)

      Name of the country.

      Parameters:
      country - value to be set
    • setTitle

      void setTitle(String title)

      Title of the contact, for example 'Dr.'

      Parameters:
      title - value to be set
    • setSalutation

      void setSalutation(String salutation)

      Salutation of the contact, for example 'Mr.' or 'Ms.'

      Parameters:
      salutation - value to be set
    • setFirstName

      void setFirstName(String firstName)

      Given name (first name) of the contact.

      Parameters:
      firstName - value to be set
    • setLastName

      void setLastName(String lastName)

      Family name (last name) of the contact.

      Parameters:
      lastName - value to be set
    • setStreetName

      void setStreetName(String streetName)

      Name of the street.

      Parameters:
      streetName - value to be set
    • setStreetNumber

      void setStreetNumber(String streetNumber)

      Street number.

      Parameters:
      streetNumber - value to be set
    • setAdditionalStreetInfo

      void setAdditionalStreetInfo(String additionalStreetInfo)

      Further information on the street address.

      Parameters:
      additionalStreetInfo - value to be set
    • setPostalCode

      void setPostalCode(String postalCode)

      Postal code.

      Parameters:
      postalCode - value to be set
    • setCity

      void setCity(String city)

      Name of the city.

      Parameters:
      city - value to be set
    • setRegion

      void setRegion(String region)

      Name of the region.

      Parameters:
      region - value to be set
    • setState

      void setState(String state)

      Name of the state, for example, Colorado.

      Parameters:
      state - value to be set
    • setCompany

      void setCompany(String company)

      Name of the company.

      Parameters:
      company - value to be set
    • setDepartment

      void setDepartment(String department)

      Name of the department.

      Parameters:
      department - value to be set
    • setBuilding

      void setBuilding(String building)

      Number or name of the building.

      Parameters:
      building - value to be set
    • setApartment

      void setApartment(String apartment)

      Number or name of the apartment.

      Parameters:
      apartment - value to be set
    • setPOBox

      void setPOBox(String pOBox)

      Post office box number.

      Parameters:
      pOBox - value to be set
    • setPhone

      void setPhone(String phone)

      Phone number of the contact.

      Parameters:
      phone - value to be set
    • setMobile

      void setMobile(String mobile)

      Mobile phone number of the contact.

      Parameters:
      mobile - value to be set
    • setEmail

      void setEmail(String email)

      Email address of the contact.

      Parameters:
      email - value to be set
    • setFax

      void setFax(String fax)

      Fax number of the contact.

      Parameters:
      fax - value to be set
    • setAdditionalAddressInfo

      void setAdditionalAddressInfo(String additionalAddressInfo)

      Further information on the Address.

      Parameters:
      additionalAddressInfo - value to be set
    • setExternalId

      void setExternalId(String externalId)

      ID for the contact used in an external system.

      Parameters:
      externalId - value to be set
    • of

      static BaseAddress of()
      factory method
      Returns:
      instance of BaseAddress
    • of

      static BaseAddress of(BaseAddress template)
      factory method to create a shallow copy BaseAddress
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static BaseAddress deepCopy(@Nullable BaseAddress template)
      factory method to create a deep copy of BaseAddress
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static BaseAddressBuilder builder()
      builder factory method for BaseAddress
      Returns:
      builder
    • builder

      static BaseAddressBuilder builder(BaseAddress template)
      create builder for BaseAddress instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withBaseAddress

      default <T> T withBaseAddress(Function<BaseAddress,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<BaseAddress> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference