Interface BaseAddress
- All Superinterfaces:
BaseAddressMixin,WithKey
- All Known Subinterfaces:
Address,AddressDraft
Polymorphic base type that represents a postal address and contact details. Depending on the read or write action, it can be either Address or AddressDraft that only differ in the data type for the optional custom field.
Example to create an instance using the builder pattern
BaseAddress baseAddress = BaseAddress.builder()
.country("{country}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic BaseAddressBuilderbuilder()builder factory method for BaseAddressstatic BaseAddressBuilderbuilder(BaseAddress template) create builder for BaseAddress instancecopyDeep()static BaseAddressdeepCopy(BaseAddress template) factory method to create a deep copy of BaseAddressFurther information on the Address.Further information on the street address.Number or name of the apartment.Number or name of the building.getCity()Name of the city.Name of the company.@NotNull StringName of the country.Name of the department.getEmail()Email address of the contact.ID for the contact used in an external system.getFax()Fax number of the contact.Given name (first name) of the contact.getId()Unique identifier of the Address.getKey()User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, anditemShippingAddresses(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.Family name (last name) of the contact.Mobile phone number of the contact.getPhone()Phone number of the contact.getPOBox()Post office box number.Postal code.Name of the region.Salutation of the contact, for example 'Mr.' or 'Ms.'getState()Name of the state, for example, Colorado.Name of the street.Street number.getTitle()Title of the contact, for example 'Dr.'static BaseAddressof()factory methodstatic BaseAddressof(BaseAddress template) factory method to create a shallow copy BaseAddressvoidsetAdditionalAddressInfo(String additionalAddressInfo) Further information on the Address.voidsetAdditionalStreetInfo(String additionalStreetInfo) Further information on the street address.voidsetApartment(String apartment) Number or name of the apartment.voidsetBuilding(String building) Number or name of the building.voidName of the city.voidsetCompany(String company) Name of the company.voidsetCountry(String country) Name of the country.voidsetDepartment(String department) Name of the department.voidEmail address of the contact.voidsetExternalId(String externalId) ID for the contact used in an external system.voidFax number of the contact.voidsetFirstName(String firstName) Given name (first name) of the contact.voidUnique identifier of the Address.voidUser-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, anditemShippingAddresses(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.voidsetLastName(String lastName) Family name (last name) of the contact.voidMobile phone number of the contact.voidPhone number of the contact.voidPost office box number.voidsetPostalCode(String postalCode) Postal code.voidName of the region.voidsetSalutation(String salutation) Salutation of the contact, for example 'Mr.' or 'Ms.'voidName of the state, for example, Colorado.voidsetStreetName(String streetName) Name of the street.voidsetStreetNumber(String streetNumber) Street number.voidTitle of the contact, for example 'Dr.'static com.fasterxml.jackson.core.type.TypeReference<BaseAddress>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithBaseAddress(Function<BaseAddress, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.common.BaseAddressMixin
equalsIgnoreId, toDraft, toDraftBuilder
-
Method Details
-
getId
String getId()Unique identifier of the Address.
It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. Use
keyinstead and omit this field from the request to let the API generate the ID for the Address.- Returns:
- id
-
getKey
String getKey()User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and
itemShippingAddresses(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.- Specified by:
getKeyin interfaceBaseAddressMixin- Specified by:
getKeyin interfaceWithKey- Returns:
- key
-
getCountry
Name of the country.
- Specified by:
getCountryin interfaceBaseAddressMixin- Returns:
- country
-
getTitle
String getTitle()Title of the contact, for example 'Dr.'
- Specified by:
getTitlein interfaceBaseAddressMixin- Returns:
- title
-
getSalutation
String getSalutation()Salutation of the contact, for example 'Mr.' or 'Ms.'
- Specified by:
getSalutationin interfaceBaseAddressMixin- Returns:
- salutation
-
getFirstName
String getFirstName()Given name (first name) of the contact.
- Specified by:
getFirstNamein interfaceBaseAddressMixin- Returns:
- firstName
-
getLastName
String getLastName()Family name (last name) of the contact.
- Specified by:
getLastNamein interfaceBaseAddressMixin- Returns:
- lastName
-
getStreetName
String getStreetName()Name of the street.
- Specified by:
getStreetNamein interfaceBaseAddressMixin- Returns:
- streetName
-
getStreetNumber
String getStreetNumber()Street number.
- Specified by:
getStreetNumberin interfaceBaseAddressMixin- Returns:
- streetNumber
-
getAdditionalStreetInfo
String getAdditionalStreetInfo()Further information on the street address.
- Specified by:
getAdditionalStreetInfoin interfaceBaseAddressMixin- Returns:
- additionalStreetInfo
-
getPostalCode
String getPostalCode()Postal code.
- Specified by:
getPostalCodein interfaceBaseAddressMixin- Returns:
- postalCode
-
getCity
String getCity()Name of the city.
- Specified by:
getCityin interfaceBaseAddressMixin- Returns:
- city
-
getRegion
String getRegion()Name of the region.
- Specified by:
getRegionin interfaceBaseAddressMixin- Returns:
- region
-
getState
String getState()Name of the state, for example, Colorado.
- Specified by:
getStatein interfaceBaseAddressMixin- Returns:
- state
-
getCompany
String getCompany()Name of the company.
- Specified by:
getCompanyin interfaceBaseAddressMixin- Returns:
- company
-
getDepartment
String getDepartment()Name of the department.
- Specified by:
getDepartmentin interfaceBaseAddressMixin- Returns:
- department
-
getBuilding
String getBuilding()Number or name of the building.
- Specified by:
getBuildingin interfaceBaseAddressMixin- Returns:
- building
-
getApartment
String getApartment()Number or name of the apartment.
- Specified by:
getApartmentin interfaceBaseAddressMixin- Returns:
- apartment
-
getPOBox
String getPOBox()Post office box number.
- Specified by:
getPOBoxin interfaceBaseAddressMixin- Returns:
- pOBox
-
getPhone
String getPhone()Phone number of the contact.
- Specified by:
getPhonein interfaceBaseAddressMixin- Returns:
- phone
-
getMobile
String getMobile()Mobile phone number of the contact.
- Specified by:
getMobilein interfaceBaseAddressMixin- Returns:
- mobile
-
getEmail
String getEmail()Email address of the contact.
- Specified by:
getEmailin interfaceBaseAddressMixin- Returns:
-
getFax
String getFax()Fax number of the contact.
- Specified by:
getFaxin interfaceBaseAddressMixin- Returns:
- fax
-
getAdditionalAddressInfo
String getAdditionalAddressInfo()Further information on the Address.
- Specified by:
getAdditionalAddressInfoin interfaceBaseAddressMixin- Returns:
- additionalAddressInfo
-
getExternalId
String getExternalId()ID for the contact used in an external system.
- Specified by:
getExternalIdin interfaceBaseAddressMixin- Returns:
- externalId
-
setId
Unique identifier of the Address.
It is not recommended to set it manually since the API overwrites this ID when creating an Address for a Customer. Use
keyinstead and omit this field from the request to let the API generate the ID for the Address.- Parameters:
id- value to be set
-
setKey
User-defined identifier of the Address that must be unique when multiple addresses are referenced in BusinessUnits, Customers, and
itemShippingAddresses(LineItem-specific addresses) of a Cart, Order, QuoteRequest, or Quote.- Parameters:
key- value to be set
-
setCountry
Name of the country.
- Parameters:
country- value to be set
-
setTitle
Title of the contact, for example 'Dr.'
- Parameters:
title- value to be set
-
setSalutation
Salutation of the contact, for example 'Mr.' or 'Ms.'
- Parameters:
salutation- value to be set
-
setFirstName
Given name (first name) of the contact.
- Parameters:
firstName- value to be set
-
setLastName
Family name (last name) of the contact.
- Parameters:
lastName- value to be set
-
setStreetName
Name of the street.
- Parameters:
streetName- value to be set
-
setStreetNumber
Street number.
- Parameters:
streetNumber- value to be set
-
setAdditionalStreetInfo
Further information on the street address.
- Parameters:
additionalStreetInfo- value to be set
-
setPostalCode
Postal code.
- Parameters:
postalCode- value to be set
-
setCity
Name of the city.
- Parameters:
city- value to be set
-
setRegion
Name of the region.
- Parameters:
region- value to be set
-
setState
Name of the state, for example, Colorado.
- Parameters:
state- value to be set
-
setCompany
Name of the company.
- Parameters:
company- value to be set
-
setDepartment
Name of the department.
- Parameters:
department- value to be set
-
setBuilding
Number or name of the building.
- Parameters:
building- value to be set
-
setApartment
Number or name of the apartment.
- Parameters:
apartment- value to be set
-
setPOBox
Post office box number.
- Parameters:
pOBox- value to be set
-
setPhone
Phone number of the contact.
- Parameters:
phone- value to be set
-
setMobile
Mobile phone number of the contact.
- Parameters:
mobile- value to be set
-
setEmail
Email address of the contact.
- Parameters:
email- value to be set
-
setFax
Fax number of the contact.
- Parameters:
fax- value to be set
-
setAdditionalAddressInfo
Further information on the Address.
- Parameters:
additionalAddressInfo- value to be set
-
setExternalId
ID for the contact used in an external system.
- Parameters:
externalId- value to be set
-
of
factory method- Returns:
- instance of BaseAddress
-
of
factory method to create a shallow copy BaseAddress- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
BaseAddress copyDeep() -
deepCopy
factory method to create a deep copy of BaseAddress- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for BaseAddress- Returns:
- builder
-
builder
create builder for BaseAddress instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withBaseAddress
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-