Interface AddressService
-
- All Known Subinterfaces:
AddressService
- All Known Implementing Classes:
ChineseAddressService,DefaultAddressService
public interface AddressServiceInterface for the address handling.- Since:
- 4.3
- Spring Bean ID:
- addressService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AddressModelcloneAddress(AddressModel address)Clones an address and sets a link on the new address to the original address.AddressModelcloneAddressForOwner(AddressModel address, ItemModel owner)Clones an address but for the given owner and sets a link on the new address to the original address.AddressModelcreateAddressForOwner(ItemModel owner)Creates a new, not persistedAddressModelfor the given owner.AddressModelcreateAddressForUser(UserModel user)Creates a new, not persistedAddressModelfor the given user.java.util.Collection<AddressModel>getAddressesForOwner(ItemModel owner)Gets aCollectionofaddressesfor the given owner e.g.
-
-
-
Method Detail
-
createAddressForUser
AddressModel createAddressForUser(UserModel user)
Creates a new, not persistedAddressModelfor the given user.- Parameters:
user- creates an address for thisUserModel- Returns:
- a new, not persisted
AddressModel - Throws:
java.lang.IllegalArgumentException- if the given user isnull
-
createAddressForOwner
AddressModel createAddressForOwner(ItemModel owner)
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:
java.lang.IllegalArgumentException- if the given owner isnull
-
getAddressesForOwner
java.util.Collection<AddressModel> getAddressesForOwner(ItemModel owner)
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:
java.lang.IllegalArgumentException- if the given owner isnull
-
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:
java.lang.IllegalArgumentException- if the given address isnull
-
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 cloneowner- the owner of the new cloned address- Returns:
- a new created,
not persistedclone of the given address - Throws:
java.lang.IllegalArgumentException- if the given address isnullor the given owner isnull
-
-