Class ItemsServiceImpl<T extends ItemDTO>
java.lang.Object
info.ejava.examples.svc.aop.items.services.ItemsServiceImpl<T>
- All Implemented Interfaces:
ItemsService<T>
- Direct Known Subclasses:
BedsServiceImpl
,GrillsServiceImpl
,MowersServiceImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ConcurrentMap
<Integer, T> private com.fasterxml.jackson.databind.ObjectMapper
private AtomicInteger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate T
Place a clone of the provided objects into storage since tests are all running within the same JVM instance/thread.createItem
(T item) void
deleteItem
(int id) void
getItem
(int id) updateItem
(int id, T item)
-
Field Details
-
nextId
-
items
-
mapper
private com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Constructor Details
-
ItemsServiceImpl
public ItemsServiceImpl()
-
-
Method Details
-
createItem
- Specified by:
createItem
in interfaceItemsService<T extends ItemDTO>
-
clone
Place a clone of the provided objects into storage since tests are all running within the same JVM instance/thread. This prevents accidental instance reuse and easier to make sense of post-test status.- Parameters:
original
-- Returns:
- copy of original
-
updateItem
- Specified by:
updateItem
in interfaceItemsService<T extends ItemDTO>
-
getItem
- Specified by:
getItem
in interfaceItemsService<T extends ItemDTO>
-
deleteItem
public void deleteItem(int id) - Specified by:
deleteItem
in interfaceItemsService<T extends ItemDTO>
-
deleteItems
public void deleteItems()- Specified by:
deleteItems
in interfaceItemsService<T extends ItemDTO>
-