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 Summary
Modifier and TypeMethodDescriptioncloneAddress(AddressModel address) Clones an address and sets a link on the new address to the original address.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.createAddressForOwner(ItemModel owner) Creates a new, not persistedAddressModelfor the given owner.Creates a new, not persistedAddressModelfor the given user.getAddressesForOwner(ItemModel owner) Gets aCollectionofaddressesfor the given owner e.g.
-
Method Details
-
createAddressForUser
Creates a new, not persistedAddressModelfor the given user.- Parameters:
user- creates an address for thisUserModel- Returns:
- a new, not persisted
AddressModel - Throws:
IllegalArgumentException- if the given user isnull
-
createAddressForOwner
Creates a new, not persistedAddressModelfor the given owner.- Parameters:
owner- the owner (can be any item) for the address, as example: can be aUserModel,CartModelorOrderModel- Returns:
- a new, not persisted address
- Throws:
IllegalArgumentException- if the given owner isnull
-
getAddressesForOwner
Gets aCollectionofaddressesfor 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 isnull
-
cloneAddress
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 isnull
-
cloneAddressForOwner
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 cloneowner- the owner of the new cloned address- Returns:
- a new created,
not persistedclone of the given address - Throws:
IllegalArgumentException- if the given address isnullor the given owner isnull
-