public class ItemServiceImpl extends Object implements ItemService
| Constructor and Description |
|---|
ItemServiceImpl(ItemRepository itemRepository)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
long |
create(Item item)
Creates new item
|
void |
delete(Item item)
Deletes item
|
List<Item> |
getAllItems()
Returns list of all items
|
List<Item> |
getByCategory(Category c)
Returns all items belonging to given category
|
Item |
getByEan(long ean)
Return item of given ean
|
Item |
getById(long id)
Return item of given id
|
void |
update(Item item)
Updates item
|
public ItemServiceImpl(ItemRepository itemRepository)
itemRepository - item repositorypublic long create(Item item) throws ServiceException
ItemServicecreate in interface ItemServiceitem - Item to be createdServiceException - when there are any unexpected problemspublic void update(Item item) throws ServiceException
ItemServiceupdate in interface ItemServiceitem - Item to be updatedServiceException - when there are any unexpected problemspublic void delete(Item item) throws ServiceException
ItemServicedelete in interface ItemServiceitem - Item to be deletedServiceException - when there are any unexpected problemspublic Item getById(long id)
ItemServicegetById in interface ItemServiceid - Id of itempublic Item getByEan(long ean)
ItemServicegetByEan in interface ItemServiceean - EAN of itempublic List<Item> getByCategory(Category c)
ItemServicegetByCategory in interface ItemServicec - categorypublic List<Item> getAllItems()
ItemServicegetAllItems in interface ItemServiceCopyright © 2017 Pivotal Software, Inc.. All rights reserved.