Interface Address

All Superinterfaces:
BaseAddress, BaseAddressMixin, Customizable<Address>, WithKey

public interface Address extends BaseAddress, Customizable<Address>

Address type returned by read methods. Optionally, the custom field can be present in addition to the fields of a BaseAddress.


Example to create an instance using the builder pattern

     Address address = Address.builder()
             .country("{country}")
             .build()
 
  • Method Details

    • getCustom

      @Valid @Valid CustomFields getCustom()

      Custom Fields defined for the Address.

      Specified by:
      getCustom in interface Customizable<Address>
      Returns:
      custom
    • getId

      String getId()
      Description copied from interface: BaseAddress

      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 key instead and omit this field from the request to let the API generate the ID for the Address.

      Specified by:
      getId in interface BaseAddress
      Returns:
      id
    • setCustom

      void setCustom(CustomFields custom)

      Custom Fields defined for the Address.

      Specified by:
      setCustom in interface Customizable<Address>
      Parameters:
      custom - value to be set
    • setId

      void setId(String id)
      set id
      Specified by:
      setId in interface BaseAddress
      Parameters:
      id - value to be set
    • of

      static Address of()
      factory method
      Returns:
      instance of Address
    • of

      static Address of(Address template)
      factory method to create a shallow copy Address
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static Address deepCopy(@Nullable Address template)
      factory method to create a deep copy of Address
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static AddressBuilder builder()
      builder factory method for Address
      Returns:
      builder
    • builder

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

      default <T> T withAddress(Function<Address,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<Address> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference