Class CustomerAddressBuilder

java.lang.Object
com.commercetools.importapi.models.customers.CustomerAddressBuilder
All Implemented Interfaces:
Builder<CustomerAddress>

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

     CustomerAddress customerAddress = CustomerAddress.builder()
             .key("{key}")
             .country("{country}")
             .build()
 
  • Constructor Details

    • CustomerAddressBuilder

      public CustomerAddressBuilder()
  • Method Details

    • key

      public CustomerAddressBuilder key(String key)

      User-defined identifier for the address. Must follow the pattern [a-zA-Z0-9_\-]{2,256} and must be unique per customer.

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

      public CustomerAddressBuilder country(String country)

      Name of the country.

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

      public CustomerAddressBuilder title(@Nullable String title)

      Title of the contact, for example 'Dr.'

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

      public CustomerAddressBuilder salutation(@Nullable String salutation)

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

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

      public CustomerAddressBuilder firstName(@Nullable String firstName)

      Given name (first name) of the contact.

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

      public CustomerAddressBuilder lastName(@Nullable String lastName)

      Family name (last name) of the contact.

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

      public CustomerAddressBuilder streetName(@Nullable String streetName)

      Name of the street.

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

      public CustomerAddressBuilder streetNumber(@Nullable String streetNumber)

      Street number.

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

      public CustomerAddressBuilder additionalStreetInfo(@Nullable String additionalStreetInfo)

      Further information on the street address.

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

      public CustomerAddressBuilder postalCode(@Nullable String postalCode)

      Postal code.

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

      Name of the city.

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

      public CustomerAddressBuilder region(@Nullable String region)

      Name of the region.

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

      public CustomerAddressBuilder state(@Nullable String state)

      Name of the state, for example, Colorado.

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

      public CustomerAddressBuilder company(@Nullable String company)

      Name of the company.

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

      public CustomerAddressBuilder department(@Nullable String department)

      Name of the department.

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

      public CustomerAddressBuilder building(@Nullable String building)

      Number or name of the building.

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

      public CustomerAddressBuilder apartment(@Nullable String apartment)

      Number or name of the apartment.

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

      public CustomerAddressBuilder pOBox(@Nullable String pOBox)

      Post office box number.

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

      public CustomerAddressBuilder phone(@Nullable String phone)

      Phone number of the contact.

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

      public CustomerAddressBuilder mobile(@Nullable String mobile)

      Mobile phone number of the contact.

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

      public CustomerAddressBuilder 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 CustomerAddressBuilder additionalAddressInfo(@Nullable String additionalAddressInfo)

      Further information on the Address.

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

      public CustomerAddressBuilder externalId(@Nullable String externalId)

      ID for the contact used in an external system.

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

      Custom Fields for the address.

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

      public CustomerAddressBuilder withCustom(Function<CustomBuilder,Custom> builder)

      Custom Fields for the address.

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

      public CustomerAddressBuilder custom(@Nullable Custom custom)

      Custom Fields for the address.

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

      public String getKey()

      User-defined identifier for the address. Must follow the pattern [a-zA-Z0-9_\-]{2,256} and must be unique per customer.

      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 Custom getCustom()

      Custom Fields for the address.

      Returns:
      custom
    • build

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

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

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

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