UserAddressRequest.Builder

  • The UserAddressRequest.Builder class is used to create instances of UserAddressRequest.

  • This builder allows you to restrict address selection to a specified set of countries, otherwise, any address can be selected.

  • You can add single or multiple allowed country specifications using the addAllowedCountrySpecification and addAllowedCountrySpecifications methods respectively.

  • The build() method creates and returns the UserAddressRequest instance.

public final class UserAddressRequest.Builder extends Object

Builder for creating a UserAddressRequest. This class lets your create an instance of UserAddressRequest that specifies a set of countries for restricting the choice of addresses by the user, i.e. the user can only select an address if it's in one of the specified countries. If no countries are specified, then there are no restrictions and the user can select any of their addresses to share with your app.

Public Method Summary

UserAddressRequest.Builder
addAllowedCountrySpecification(CountrySpecification countrySpecification)
Specifies a country whose addresses can be handled by your app.
UserAddressRequest.Builder
addAllowedCountrySpecifications(Collection<CountrySpecification> countrySpecifications)
Specifies multiple countries whose addresses can be handled by your app.
UserAddressRequest
build()
Builds an instance of UserAddressRequest and returns it.

Inherited Method Summary

Public Methods

public UserAddressRequest.Builder addAllowedCountrySpecification (CountrySpecification countrySpecification)

Specifies a country whose addresses can be handled by your app. Note that calling this after you have called build() will cause a runtime exception to be thrown.

public UserAddressRequest.Builder addAllowedCountrySpecifications (Collection<CountrySpecification> countrySpecifications)

Specifies multiple countries whose addresses can be handled by your app. Note that calling this after you have called build() will cause a runtime exception to be thrown.

public UserAddressRequest build ()

Builds an instance of UserAddressRequest and returns it.