Interface AddressService

All Known Subinterfaces:
AddressService
All Known Implementing Classes:
ChineseAddressService, DefaultAddressService

public interface AddressService
Interface for the address handling.
Since:
4.3
Spring Bean ID:
addressService
  • Method Details

    • createAddressForUser

      AddressModel createAddressForUser(UserModel user)
      Creates a new, not persisted AddressModel for the given user.
      Parameters:
      user - creates an address for this UserModel
      Returns:
      a new, not persisted AddressModel
      Throws:
      IllegalArgumentException - if the given user is null
    • createAddressForOwner

      AddressModel createAddressForOwner(ItemModel owner)
      Creates a new, not persisted AddressModel for the given owner.
      Parameters:
      owner - the owner (can be any item) for the address, as example: can be a UserModel, CartModel or OrderModel
      Returns:
      a new, not persisted address
      Throws:
      IllegalArgumentException - if the given owner is null
    • getAddressesForOwner

      Collection<AddressModel> getAddressesForOwner(ItemModel owner)
      Gets a Collection of addresses for the given owner e.g. a user or an order.

      The owner can be any item.

      Parameters:
      owner - the given owner, can be an order, a cart or a user
      Returns:
      an empty collection if nothing was found
      Throws:
      IllegalArgumentException - if the given owner is null
    • cloneAddress

      AddressModel cloneAddress(AddressModel address)
      Clones an address and sets a link on the new address to the original address.

      The new address has the same owner as the given address.

      Parameters:
      address - the address to clone
      Returns:
      a new created, not persisted clone of the given address
      Throws:
      IllegalArgumentException - if the given address is null
    • cloneAddressForOwner

      AddressModel cloneAddressForOwner(AddressModel address, ItemModel owner)
      Clones an address but for the given owner and sets a link on the new address to the original address.
      Parameters:
      address - the address to clone
      owner - the owner of the new cloned address
      Returns:
      a new created, not persisted clone of the given address
      Throws:
      IllegalArgumentException - if the given address is null or the given owner is null