Class AddressBuilder

java.lang.Object
com.commercetools.history.models.common.AddressBuilder
All Implemented Interfaces:
Builder<Address>

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

     Address address = Address.builder()
             .id("{id}")
             .key("{key}")
             .title("{title}")
             .salutation("{salutation}")
             .firstName("{firstName}")
             .lastName("{lastName}")
             .streetName("{streetName}")
             .streetNumber("{streetNumber}")
             .additionalStreetInfo("{additionalStreetInfo}")
             .postalCode("{postalCode}")
             .city("{city}")
             .region("{region}")
             .state("{state}")
             .country("{country}")
             .company("{company}")
             .department("{department}")
             .building("{building}")
             .apartment("{apartment}")
             .pOBox("{pOBox}")
             .phone("{phone}")
             .mobile("{mobile}")
             .email("{email}")
             .fax("{fax}")
             .additionalAddressInfo("{additionalAddressInfo}")
             .externalId("{externalId}")
             .build()
 
  • Constructor Details

    • AddressBuilder

      public AddressBuilder()
  • Method Details

    • id

      public AddressBuilder id(String id)

      Unique ID of the Address.

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

      public AddressBuilder key(String key)
      set the value to the key
      Parameters:
      key - value to be set
      Returns:
      Builder
    • title

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

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

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

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

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

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

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

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

      public AddressBuilder city(String city)
      set the value to the city
      Parameters:
      city - value to be set
      Returns:
      Builder
    • region

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

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

      public AddressBuilder country(String country)

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

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

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

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

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

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

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

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

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

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

      public AddressBuilder fax(String fax)
      set the value to the fax
      Parameters:
      fax - value to be set
      Returns:
      Builder
    • additionalAddressInfo

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

      public AddressBuilder externalId(String externalId)
      set the value to the externalId
      Parameters:
      externalId - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique ID of the Address.

      Returns:
      id
    • getKey

      public String getKey()
      value of key}
      Returns:
      key
    • getTitle

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

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

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

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

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

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

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

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

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

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

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

      public String getCountry()

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

      Returns:
      country
    • getCompany

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

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

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

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

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

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

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

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

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

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

      public String getExternalId()
      value of externalId}
      Returns:
      externalId
    • build

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

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

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

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