Class SuperUserSimpleInventoryItemService
java.lang.Object
dev.getelements.elements.service.inventory.SuperUserSimpleInventoryItemService
- All Implemented Interfaces:
SimpleInventoryItemService
public class SuperUserSimpleInventoryItemService
extends Object
implements SimpleInventoryItemService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadjustInventoryItemQuantity(String inventoryItemId, String userId, int quantityDelta) Adjusts the quantity of theInventoryItemassociated with the specifiedItem.createInventoryItem(String userId, String itemId, int initialQuantity) Creates a newInventoryItemfor the specifiedItem.voiddeleteInventoryItem(String inventoryItemId) Deletes anInventoryItemfrom the givenUser's inventory.getInventoryItem(String inventoryItemId) Returns theInventoryItemassociated with the specified id.getInventoryItems(int offset, int count, String userId) Returns a list ofInventoryItemobjects.getInventoryItems(int offset, int count, String userId, String query) Returns a list ofInventoryItemobjects.getUser()voidsetInventoryItemDao(InventoryItemDao inventoryItemDao) voidsetItemDao(ItemDao itemDao) voidvoidsetUserDao(UserDao userDao) updateInventoryItem(String inventoryItemId, int quantity) Updates an inventory item with the supplied user id, item id, and quantity.
-
Constructor Details
-
SuperUserSimpleInventoryItemService
public SuperUserSimpleInventoryItemService()
-
-
Method Details
-
getInventoryItem
Description copied from interface:SimpleInventoryItemServiceReturns theInventoryItemassociated with the specified id.- Specified by:
getInventoryItemin interfaceSimpleInventoryItemService- Parameters:
inventoryItemId- the id of the as specified byInventoryItem.getId()- Returns:
- the
InventoryItemassociated with specified item
-
getInventoryItems
Description copied from interface:SimpleInventoryItemServiceReturns a list ofInventoryItemobjects.- Specified by:
getInventoryItemsin interfaceSimpleInventoryItemService- Parameters:
offset- the offsetcount- the countuserId- the user id to filter, pass null or empty to fetch all- Returns:
- the list of
InventoryIteminstances
-
getInventoryItems
public Pagination<InventoryItem> getInventoryItems(int offset, int count, String userId, String query) Description copied from interface:SimpleInventoryItemServiceReturns a list ofInventoryItemobjects.- Specified by:
getInventoryItemsin interfaceSimpleInventoryItemService- Parameters:
offset- the offsetcount- the countuserId- the user id to filter, pass null or empty to fetch allquery- the search query- Returns:
- the list of
InventoryIteminstances
-
adjustInventoryItemQuantity
public InventoryItem adjustInventoryItemQuantity(String inventoryItemId, String userId, int quantityDelta) Description copied from interface:SimpleInventoryItemServiceAdjusts the quantity of theInventoryItemassociated with the specifiedItem.- Specified by:
adjustInventoryItemQuantityin interfaceSimpleInventoryItemService- Parameters:
inventoryItemId- the value ofInventoryItem.getId()userId- the user's idquantityDelta- the amount by which to adjust the quantity of theInventoryItem- Returns:
- the
InventoryItemas it was written to the database
-
createInventoryItem
Description copied from interface:SimpleInventoryItemServiceCreates a newInventoryItemfor the specifiedItem.- Specified by:
createInventoryItemin interfaceSimpleInventoryItemService- Parameters:
userId- the user to own theInventoryItemitemId- theItem.getName()orItem.getId()to use.initialQuantity- the initial quantity- Returns:
- the
InventoryItemas it was written to the database
-
updateInventoryItem
Description copied from interface:SimpleInventoryItemServiceUpdates an inventory item with the supplied user id, item id, and quantity.- Specified by:
updateInventoryItemin interfaceSimpleInventoryItemService- Parameters:
inventoryItemId- the inventory item idquantity- the quantity to set- Returns:
- the updated
InventoryItem
-
deleteInventoryItem
Description copied from interface:SimpleInventoryItemServiceDeletes anInventoryItemfrom the givenUser's inventory.- Specified by:
deleteInventoryItemin interfaceSimpleInventoryItemService- Parameters:
inventoryItemId- theInventoryItem's id.
-
getItemDao
-
setItemDao
-
getInventoryItemDao
-
setInventoryItemDao
-
getUserDao
-
setUserDao
-
getUser
-
setUser
-