Interface SimpleInventoryItemService
- All Known Implementing Classes:
SuperUserSimpleInventoryItemService
,UserSimpleInventoryItemService
public interface SimpleInventoryItemService
-
Method Summary
Modifier and TypeMethodDescriptionadjustInventoryItemQuantity
(String inventoryItemId, String userId, int quantityDelta) Adjusts the quantity of theInventoryItem
associated with the specifiedItem
.createInventoryItem
(String userId, String itemNameOrId, int initialQuantity) Creates a newInventoryItem
for the specifiedItem
.void
deleteInventoryItem
(String inventoryItemId) Deletes anInventoryItem
from the givenUser
's inventory.getInventoryItem
(String inventoryItemId) Returns theInventoryItem
associated with the specified id.getInventoryItems
(int offset, int count, String userId) Returns a list ofInventoryItem
objects.getInventoryItems
(int offset, int count, String userId, String query) Returns a list ofInventoryItem
objects.updateInventoryItem
(String inventoryItemId, int quantity) Updates an inventory item with the supplied user id, item id, and quantity.
-
Method Details
-
getInventoryItem
Returns theInventoryItem
associated with the specified id.- Parameters:
inventoryItemId
- the id of the as specified byInventoryItem.getId()
- Returns:
- the
InventoryItem
associated with specified item
-
getInventoryItems
Returns a list ofInventoryItem
objects.- Parameters:
offset
- the offsetcount
- the countuserId
- the user id to filter, pass null or empty to fetch all- Returns:
- the list of
InventoryItem
instances
-
getInventoryItems
Returns a list ofInventoryItem
objects.- 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
InventoryItem
instances
-
adjustInventoryItemQuantity
Adjusts the quantity of theInventoryItem
associated with the specifiedItem
.- Parameters:
inventoryItemId
- the value ofInventoryItem.getId()
userId
- the user's idquantityDelta
- the amount by which to adjust the quantity of theInventoryItem
- Returns:
- the
InventoryItem
as it was written to the database
-
createInventoryItem
Creates a newInventoryItem
for the specifiedItem
.- Parameters:
userId
- the user to own theInventoryItem
itemNameOrId
- theItem.getName()
orItem.getId()
to use.initialQuantity
- the initial quantity- Returns:
- the
InventoryItem
as it was written to the database
-
updateInventoryItem
Updates an inventory item with the supplied user id, item id, and quantity.- Parameters:
inventoryItemId
- the inventory item idquantity
- the quantity to set- Returns:
- the updated
InventoryItem
-
deleteInventoryItem
Deletes anInventoryItem
from the givenUser
's inventory.- Parameters:
inventoryItemId
- theInventoryItem
's id.
-