Class AddressDraftBuilder

java.lang.Object
com.commercetools.api.models.common.AddressDraftBuilder
All Implemented Interfaces:
Builder<AddressDraft>

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

     AddressDraft addressDraft = AddressDraft.builder()
             .country("{country}")
             .build()
 
  • Constructor Details

    • AddressDraftBuilder

      public AddressDraftBuilder()
  • Method Details

    • 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
      Returns:
      Builder
    • 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
      Returns:
      Builder
    • country

      public AddressDraftBuilder country(String country)

      Name of the country.

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

      public AddressDraftBuilder title(@Nullable String title)

      Title of the contact, for example 'Dr.'

      Parameters:
      title - value to be set
      Returns:
      Builder
    • salutation

      public AddressDraftBuilder salutation(@Nullable String salutation)

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

      Parameters:
      salutation - value to be set
      Returns:
      Builder
    • firstName

      public AddressDraftBuilder firstName(@Nullable String firstName)

      Given name (first name) of the contact.

      Parameters:
      firstName - value to be set
      Returns:
      Builder
    • lastName

      public AddressDraftBuilder lastName(@Nullable String lastName)

      Family name (last name) of the contact.

      Parameters:
      lastName - value to be set
      Returns:
      Builder
    • streetName

      public AddressDraftBuilder streetName(@Nullable String streetName)

      Name of the street.

      Parameters:
      streetName - value to be set
      Returns:
      Builder
    • streetNumber

      public AddressDraftBuilder streetNumber(@Nullable String streetNumber)

      Street number.

      Parameters:
      streetNumber - value to be set
      Returns:
      Builder
    • additionalStreetInfo

      public AddressDraftBuilder additionalStreetInfo(@Nullable String additionalStreetInfo)

      Further information on the street address.

      Parameters:
      additionalStreetInfo - value to be set
      Returns:
      Builder
    • postalCode

      public AddressDraftBuilder postalCode(@Nullable String postalCode)

      Postal code.

      Parameters:
      postalCode - value to be set
      Returns:
      Builder
    • city

      public AddressDraftBuilder city(@Nullable String city)

      Name of the city.

      Parameters:
      city - value to be set
      Returns:
      Builder
    • region

      public AddressDraftBuilder region(@Nullable String region)

      Name of the region.

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

      public AddressDraftBuilder state(@Nullable String state)

      Name of the state, for example, Colorado.

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

      public AddressDraftBuilder company(@Nullable String company)

      Name of the company.

      Parameters:
      company - value to be set
      Returns:
      Builder
    • department

      public AddressDraftBuilder department(@Nullable String department)

      Name of the department.

      Parameters:
      department - value to be set
      Returns:
      Builder
    • building

      public AddressDraftBuilder building(@Nullable String building)

      Number or name of the building.

      Parameters:
      building - value to be set
      Returns:
      Builder
    • apartment

      public AddressDraftBuilder apartment(@Nullable String apartment)

      Number or name of the apartment.

      Parameters:
      apartment - value to be set
      Returns:
      Builder
    • pOBox

      public AddressDraftBuilder pOBox(@Nullable String pOBox)

      Post office box number.

      Parameters:
      pOBox - value to be set
      Returns:
      Builder
    • phone

      public AddressDraftBuilder phone(@Nullable String phone)

      Phone number of the contact.

      Parameters:
      phone - value to be set
      Returns:
      Builder
    • mobile

      public AddressDraftBuilder mobile(@Nullable String mobile)

      Mobile phone number of the contact.

      Parameters:
      mobile - value to be set
      Returns:
      Builder
    • email

      public AddressDraftBuilder email(@Nullable String email)

      Email address of the contact.

      Parameters:
      email - value to be set
      Returns:
      Builder
    • fax

      Fax number of the contact.

      Parameters:
      fax - value to be set
      Returns:
      Builder
    • additionalAddressInfo

      public AddressDraftBuilder additionalAddressInfo(@Nullable String additionalAddressInfo)

      Further information on the Address.

      Parameters:
      additionalAddressInfo - value to be set
      Returns:
      Builder
    • externalId

      public AddressDraftBuilder externalId(@Nullable String externalId)

      ID for the contact used in an external system.

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

      Custom Fields defined for the Address.

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

      Custom Fields defined for the Address.

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

      Custom Fields defined for the Address.

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

      @Nullable public 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

      @Nullable public 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.

      Returns:
      key
    • getCountry

      public String getCountry()

      Name of the country.

      Returns:
      country
    • getTitle

      @Nullable public String getTitle()

      Title of the contact, for example 'Dr.'

      Returns:
      title
    • getSalutation

      @Nullable public String getSalutation()

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

      Returns:
      salutation
    • getFirstName

      @Nullable public String getFirstName()

      Given name (first name) of the contact.

      Returns:
      firstName
    • getLastName

      @Nullable public String getLastName()

      Family name (last name) of the contact.

      Returns:
      lastName
    • getStreetName

      @Nullable public String getStreetName()

      Name of the street.

      Returns:
      streetName
    • getStreetNumber

      @Nullable public String getStreetNumber()

      Street number.

      Returns:
      streetNumber
    • getAdditionalStreetInfo

      @Nullable public String getAdditionalStreetInfo()

      Further information on the street address.

      Returns:
      additionalStreetInfo
    • getPostalCode

      @Nullable public String getPostalCode()

      Postal code.

      Returns:
      postalCode
    • getCity

      @Nullable public String getCity()

      Name of the city.

      Returns:
      city
    • getRegion

      @Nullable public String getRegion()

      Name of the region.

      Returns:
      region
    • getState

      @Nullable public String getState()

      Name of the state, for example, Colorado.

      Returns:
      state
    • getCompany

      @Nullable public String getCompany()

      Name of the company.

      Returns:
      company
    • getDepartment

      @Nullable public String getDepartment()

      Name of the department.

      Returns:
      department
    • getBuilding

      @Nullable public String getBuilding()

      Number or name of the building.

      Returns:
      building
    • getApartment

      @Nullable public String getApartment()

      Number or name of the apartment.

      Returns:
      apartment
    • getPOBox

      @Nullable public String getPOBox()

      Post office box number.

      Returns:
      pOBox
    • getPhone

      @Nullable public String getPhone()

      Phone number of the contact.

      Returns:
      phone
    • getMobile

      @Nullable public String getMobile()

      Mobile phone number of the contact.

      Returns:
      mobile
    • getEmail

      @Nullable public String getEmail()

      Email address of the contact.

      Returns:
      email
    • getFax

      @Nullable public String getFax()

      Fax number of the contact.

      Returns:
      fax
    • getAdditionalAddressInfo

      @Nullable public String getAdditionalAddressInfo()

      Further information on the Address.

      Returns:
      additionalAddressInfo
    • getExternalId

      @Nullable public String getExternalId()

      ID for the contact used in an external system.

      Returns:
      externalId
    • getCustom

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields defined for the Address.

      Returns:
      custom
    • build

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

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

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

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