public final class AddressBuilder extends Base implements Builder<Address>
Address
instances using the Builder pattern (a stateful object).
Create an entire new address:
Address commercetoolsBerlin = AddressBuilder.of(CountryCode.DE) .company("commercetools") .firstName("John").lastName("Doe") .streetName("Schuhmannstraße").streetNumber("17") .postalCode("10117").city("Berlin") .build();
See the test code.
Create an address based on an existing address:
Address commercetoolsMunich = AddressBuilder.of(address) .streetName("Ganghoferstraße").streetNumber("68b") .postalCode("80339").city("München") .build();
See the test code.
public static AddressBuilder of(Address address)
public static AddressBuilder of(com.neovisionaries.i18n.CountryCode country)
public Address build()
Builder
public AddressBuilder country(com.neovisionaries.i18n.CountryCode country)
public AddressBuilder id(@Nullable String id)
public AddressBuilder key(@Nullable String key)
public AddressBuilder title(@Nullable String title)
public AddressBuilder salutation(@Nullable String salutation)
public AddressBuilder firstName(@Nullable String firstName)
public AddressBuilder lastName(@Nullable String lastName)
public AddressBuilder streetName(@Nullable String streetName)
public AddressBuilder streetNumber(@Nullable String streetNumber)
public AddressBuilder additionalStreetInfo(@Nullable String additionalStreetInfo)
public AddressBuilder postalCode(@Nullable String postalCode)
public AddressBuilder city(@Nullable String city)
public AddressBuilder region(@Nullable String region)
public AddressBuilder state(@Nullable String state)
public AddressBuilder company(@Nullable String company)
public AddressBuilder department(@Nullable String department)
public AddressBuilder building(@Nullable String building)
public AddressBuilder apartment(@Nullable String apartment)
public AddressBuilder poBox(@Nullable String poBox)
public AddressBuilder phone(@Nullable String phone)
public AddressBuilder mobile(@Nullable String mobile)
public AddressBuilder email(@Nullable String email)
public AddressBuilder additionalAddressInfo(@Nullable String additionalAddressInfo)
public AddressBuilder fax(@Nullable String fax)
public AddressBuilder externalId(@Nullable String externalId)
public AddressBuilder customFields(@Nullable CustomFields customFields)
public AddressBuilder customFields(@Nullable CustomFieldsDraft customFieldsDraft)