public class CategoryServiceImpl extends Object implements CategoryService
| Constructor and Description |
|---|
CategoryServiceImpl(CategoryRepository categoryRepository)
Construcot
|
| Modifier and Type | Method and Description |
|---|---|
long |
create(Category category)
Creates new category
|
void |
delete(Category category)
Deletes category
|
List<Category> |
getAllCategories()
Returns list of all categories
|
Category |
getById(long id)
Return category of given id
|
Category |
getByName(String name)
Return category of given name
|
void |
update(Category category)
Updates category
|
public CategoryServiceImpl(CategoryRepository categoryRepository)
categoryRepository - category repositorypublic long create(Category category) throws ServiceException
CategoryServicecreate in interface CategoryServicecategory - Category to be createdServiceException - when there are any unexpected problemspublic void delete(Category category) throws ServiceException
CategoryServicedelete in interface CategoryServicecategory - Category to be deletedServiceException - when there are any unexpected problemspublic void update(Category category) throws ServiceException
CategoryServiceupdate in interface CategoryServicecategory - Category to be updatedServiceException - when there are any unexpected problemspublic Category getById(long id)
CategoryServicegetById in interface CategoryServiceid - Id of categorypublic Category getByName(String name)
CategoryServicegetByName in interface CategoryServicename - Name of categorypublic List<Category> getAllCategories()
CategoryServicegetAllCategories in interface CategoryServiceCopyright © 2017 Pivotal Software, Inc.. All rights reserved.