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
    • title

      public CustomerAddressBuilder title(@Nullable String title)
      set the value to the title
      Parameters:
      title - value to be set
      Returns:
      Builder
    • salutation

      public CustomerAddressBuilder salutation(@Nullable String salutation)
      set the value to the salutation
      Parameters:
      salutation - value to be set
      Returns:
      Builder
    • firstName

      public CustomerAddressBuilder firstName(@Nullable String firstName)
      set the value to the firstName
      Parameters:
      firstName - value to be set
      Returns:
      Builder
    • lastName

      public CustomerAddressBuilder lastName(@Nullable String lastName)
      set the value to the lastName
      Parameters:
      lastName - value to be set
      Returns:
      Builder
    • streetName

      public CustomerAddressBuilder streetName(@Nullable String streetName)
      set the value to the streetName
      Parameters:
      streetName - value to be set
      Returns:
      Builder
    • streetNumber

      public CustomerAddressBuilder streetNumber(@Nullable String streetNumber)
      set the value to the streetNumber
      Parameters:
      streetNumber - value to be set
      Returns:
      Builder
    • additionalStreetInfo

      public CustomerAddressBuilder additionalStreetInfo(@Nullable String additionalStreetInfo)
      set the value to the additionalStreetInfo
      Parameters:
      additionalStreetInfo - value to be set
      Returns:
      Builder
    • postalCode

      public CustomerAddressBuilder postalCode(@Nullable String postalCode)
      set the value to the postalCode
      Parameters:
      postalCode - value to be set
      Returns:
      Builder
    • city

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

      public CustomerAddressBuilder region(@Nullable String region)
      set the value to the region
      Parameters:
      region - value to be set
      Returns:
      Builder
    • state

      public CustomerAddressBuilder state(@Nullable String state)
      set the value to the state
      Parameters:
      state - value to be set
      Returns:
      Builder
    • country

      public CustomerAddressBuilder country(String country)

      A two-digit country code as per ISO 3166-1 alpha-2.

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

      public CustomerAddressBuilder company(@Nullable String company)
      set the value to the company
      Parameters:
      company - value to be set
      Returns:
      Builder
    • department

      public CustomerAddressBuilder department(@Nullable String department)
      set the value to the department
      Parameters:
      department - value to be set
      Returns:
      Builder
    • building

      public CustomerAddressBuilder building(@Nullable String building)
      set the value to the building
      Parameters:
      building - value to be set
      Returns:
      Builder
    • apartment

      public CustomerAddressBuilder apartment(@Nullable String apartment)
      set the value to the apartment
      Parameters:
      apartment - value to be set
      Returns:
      Builder
    • pOBox

      public CustomerAddressBuilder pOBox(@Nullable String pOBox)
      set the value to the pOBox
      Parameters:
      pOBox - value to be set
      Returns:
      Builder
    • phone

      public CustomerAddressBuilder phone(@Nullable String phone)
      set the value to the phone
      Parameters:
      phone - value to be set
      Returns:
      Builder
    • mobile

      public CustomerAddressBuilder mobile(@Nullable String mobile)
      set the value to the mobile
      Parameters:
      mobile - value to be set
      Returns:
      Builder
    • email

      public CustomerAddressBuilder email(@Nullable String email)
      set the value to the email
      Parameters:
      email - value to be set
      Returns:
      Builder
    • fax

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

      public CustomerAddressBuilder additionalAddressInfo(@Nullable String additionalAddressInfo)
      set the value to the additionalAddressInfo
      Parameters:
      additionalAddressInfo - value to be set
      Returns:
      Builder
    • externalId

      public CustomerAddressBuilder externalId(@Nullable String externalId)
      set the value to the externalId
      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
    • getTitle

      @Nullable public String getTitle()
      value of title}
      Returns:
      title
    • getSalutation

      @Nullable public String getSalutation()
      value of salutation}
      Returns:
      salutation
    • getFirstName

      @Nullable public String getFirstName()
      value of firstName}
      Returns:
      firstName
    • getLastName

      @Nullable public String getLastName()
      value of lastName}
      Returns:
      lastName
    • getStreetName

      @Nullable public String getStreetName()
      value of streetName}
      Returns:
      streetName
    • getStreetNumber

      @Nullable public String getStreetNumber()
      value of streetNumber}
      Returns:
      streetNumber
    • getAdditionalStreetInfo

      @Nullable public String getAdditionalStreetInfo()
      value of additionalStreetInfo}
      Returns:
      additionalStreetInfo
    • getPostalCode

      @Nullable public String getPostalCode()
      value of postalCode}
      Returns:
      postalCode
    • getCity

      @Nullable public String getCity()
      value of city}
      Returns:
      city
    • getRegion

      @Nullable public String getRegion()
      value of region}
      Returns:
      region
    • getState

      @Nullable public String getState()
      value of state}
      Returns:
      state
    • getCountry

      public String getCountry()

      A two-digit country code as per ISO 3166-1 alpha-2.

      Returns:
      country
    • getCompany

      @Nullable public String getCompany()
      value of company}
      Returns:
      company
    • getDepartment

      @Nullable public String getDepartment()
      value of department}
      Returns:
      department
    • getBuilding

      @Nullable public String getBuilding()
      value of building}
      Returns:
      building
    • getApartment

      @Nullable public String getApartment()
      value of apartment}
      Returns:
      apartment
    • getPOBox

      @Nullable public String getPOBox()
      value of pOBox}
      Returns:
      pOBox
    • getPhone

      @Nullable public String getPhone()
      value of phone}
      Returns:
      phone
    • getMobile

      @Nullable public String getMobile()
      value of mobile}
      Returns:
      mobile
    • getEmail

      @Nullable public String getEmail()
      value of email}
      Returns:
      email
    • getFax

      @Nullable public String getFax()
      value of fax}
      Returns:
      fax
    • getAdditionalAddressInfo

      @Nullable public String getAdditionalAddressInfo()
      value of additionalAddressInfo}
      Returns:
      additionalAddressInfo
    • getExternalId

      @Nullable public String getExternalId()
      value of externalId}
      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