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.ObjectMapperprivate AtomicInteger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate TPlace a clone of the provided objects into storage since tests are all running within the same JVM instance/thread.createItem(T item) voiddeleteItem(int id) voidgetItem(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:
createItemin 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:
updateItemin interfaceItemsService<T extends ItemDTO>
-
getItem
- Specified by:
getItemin interfaceItemsService<T extends ItemDTO>
-
deleteItem
public void deleteItem(int id) - Specified by:
deleteItemin interfaceItemsService<T extends ItemDTO>
-
deleteItems
public void deleteItems()- Specified by:
deleteItemsin interfaceItemsService<T extends ItemDTO>
-