Class AddressBuilder

java.lang.Object
com.commercetools.importapi.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()
             .country("{country}")
             .build()
 
  • Constructor Details

    • AddressBuilder

      public AddressBuilder()
  • Method Details

    • id

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

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

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

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

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

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

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

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

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

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

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

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

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

      public AddressBuilder 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 AddressBuilder company(@Nullable String company)
      set the value to the company
      Parameters:
      company - value to be set
      Returns:
      Builder
    • department

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

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

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

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

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

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

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

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

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

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

      Custom Fields defined for the Address. Custom Fields can only be applied to shippingAddress.

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

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

      Custom Fields defined for the Address. Custom Fields can only be applied to shippingAddress.

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

      public AddressBuilder custom(@Nullable Custom custom)

      Custom Fields defined for the Address. Custom Fields can only be applied to shippingAddress.

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

      @Nullable public String getId()
      value of id}
      Returns:
      id
    • getKey

      @Nullable public String getKey()
      value of key}
      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 defined for the Address. Custom Fields can only be applied to shippingAddress.

      Returns:
      custom
    • 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